I built my React Native app fully in Expo and built with expo build:ios, without ever ejecting.
My app was rejected for Beta Testing in Testflight, and there are crash logs in txt file format, and this is the thread that crashed:
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000022c4d10dc 0x22c4ae000 + 143580
1 libsystem_pthread.dylib 0x000000022c54a094 0x22c548000 + 8340
2 libsystem_c.dylib 0x000000022c42aea8 0x22c3d0000 + 372392
3 libc++abi.dylib 0x000000022baf7788 0x22baf6000 + 6024
4 libc++abi.dylib 0x000000022baf7934 0x22baf6000 + 6452
5 libobjc.A.dylib 0x000000022bb0ee00 0x22bb09000 + 24064
6 libc++abi.dylib 0x000000022bb03838 0x22baf6000 + 55352
7 libc++abi.dylib 0x000000022bb038c4 0x22baf6000 + 55492
8 libdispatch.dylib 0x000000022c3747e8 0x22c314000 + 395240
9 libdispatch.dylib 0x000000022c322004 0x22c314000 + 57348
10 CoreFoundation 0x000000022c8c5c1c 0x22c81c000 + 695324
11 CoreFoundation 0x000000022c8c0b54 0x22c81c000 + 674644
12 CoreFoundation 0x000000022c8c00b0 0x22c81c000 + 671920
13 GraphicsServices 0x000000022eac079c 0x22eab6000 + 42908
14 UIKitCore 0x0000000258e30978 0x258574000 + 9161080
15 ExpoKitApp 0x00000001007fb2d8 0x1007f4000 + 29400
16 libdyld.dylib 0x000000022c3858e0 0x22c384000 + 6368
I can't figure out how to symbolicate these because all I have is a txt file.
I'm also concerned that even a symbolicated log will be helpful, because it looks like there's a single step, simply labeled ExpoKitApp, that started the crash, and I can't imagine there being much useful information that might come out of that one line.
Does anyone have experience hunting down crash bugs in an unejected Expo app?
Related
So, I developed an app in Qt. It works just fine on my MacOs virtual machine. So I deployed it, I codesigned it. But I get an error, when I'm trying to launch on another Mac device. Funnny thing is if I launch it using sudo, like sudo App.app/Contents/MacOS/App it works. The error text is
Thread 2 Crashed:: Dispatch queue: com.apple.root.default-qos
0 libsystem_kernel.dylib 0x00007fff20364792 abort_with_payload + 10
1 libsystem_kernel.dylib 0x00007fff203661d9 abort_with_payload_wrapper_internal + 80
2 libsystem_kernel.dylib 0x00007fff2036620b abort_with_payload + 9
3 com.apple.TCC 0x00007fff24bd61b4 __TCC_CRASHING_DUE_TO_PRIVACY_VIOLATION + 163
4 com.apple.TCC 0x00007fff24bd69e6 __TCCAccessRequest_block_invoke.128 + 498
5 com.apple.TCC 0x00007fff24bd460a __tccd_send_message_block_invoke + 573
6 libxpc.dylib 0x00007fff200bcab8 _xpc_connection_reply_callout + 36
7 libxpc.dylib 0x00007fff200bca40 _xpc_connection_call_reply_async + 69
8 libdispatch.dylib 0x00007fff201cc831 _dispatch_client_callout3 + 8
9 libdispatch.dylib 0x00007fff201e5010 _dispatch_mach_msg_async_reply_invoke + 375
10 libdispatch.dylib 0x00007fff201dc564 _dispatch_kevent_worker_thread + 1390
11 libsystem_pthread.dylib 0x00007fff203744e1 _pthread_wqthread + 386
12 libsystem_pthread.dylib 0x00007fff20373467 start_wqthread + 15
And I have really hard time trying to understand what's the reason for such behaviour. I read some information about related problems, and it seem like it's missing some kind of permission. But I can't understand what excatly the permission should be. Can anyone explain what should I do?
I'm trying to implement the method described here and here which override new and delete in a SWIG module in order to allocate memory on the Java heap instead of natively.
I added the SWIG prescription to my interface file. It compiles fine, and when I run my Java GUI, I can see from cout statements that it appears to be newing and deleteing without problems for a while (over 100k times). Eventually though, I always get this (same stack trace):
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fff8754c0e0, pid=61178, tid=81411
#
# JRE version: Java(TM) SE Runtime Environment (8.0_60-b27) (build 1.8.0_60-b27)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.60-b23 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [libsystem_platform.dylib+0x50e0] _platform_memmove$VARIANT$Haswell+0x1c0
Using my cout statements, it looks like the sample code is using the same addresses inside delete as it used in new, so the code itself appears to be working. There are no known memory issues with my code (I've analyzed it using AddressSanitizer and Valgrind), and furthermore, if I comment out only the cached_jvm = jvm; line (which results in the code using malloc/free instead of on the JVM heap), then it works ok. I'm not running out of heap memory -- for my testing I'm using small sample data.
If I switch the ReleaseByteArrayElements line to use mode JNI_ABORT instead of 0, then the free does not fail in the same place, but other problems occur afterwards which I didn’t bother to figure out.
Why is it segfaulting? Are there certain kinds of memory operations that are not compatible with this approach? I'm not using malloc/free (directly). I'm linking to a 3rd party library in C++, and they might be up to something.
Here's a sample compile line:
/usr/bin/clang++ -DEngine_EXPORTS -m64 -W -Wall -Wconversion -Wshadow -Wno-error=shadow -fdiagnostics-show-option -Wno-sign-conversion -stdlib=libc++ -ftemplate-depth=1000 -O3 -fno-omit-frame-pointer -ffast-math -funroll-loops -dynamic -fPIC -fno-common -fvisibility=hidden -fvisibility-inlines-hidden -Werror -Wno-error -fno-strict-aliasing -g -fPIC -I/third/party/include -I/my/include -I/System/Library/Frameworks/JavaVM.framework/Headers -o CMakeFiles/Engine.dir/engineJAVA_wrap.cxx.o -c engineJAVA_wrap.cxx
Stack trace:
Thread 59 Crashed:: Java: Thread-22
0 libsystem_kernel.dylib 0x00007fff902fbf06 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff98e704ec pthread_kill + 90
2 libsystem_c.dylib 0x00007fff95c736df abort + 129
3 libjvm.dylib 0x000000010a282beb os::abort(bool) + 25
4 libjvm.dylib 0x000000010a3a6a2a VMError::report_and_die() + 2304
5 libjvm.dylib 0x000000010a3a6d9b crash_handler(int, __siginfo*, void*) + 106
6 libsystem_platform.dylib 0x00007fff8754952a _sigtramp + 26
7 ??? 000000000000000000 0 + 0
8 libjvm.dylib 0x000000010a27d0b1 os::print_location(outputStream*, long, bool) + 917
9 libjvm.dylib 0x000000010a283d89 os::print_register_info(outputStream*, void*) + 83
10 libjvm.dylib 0x000000010a3a588c VMError::report(outputStream*) + 2142
11 libjvm.dylib 0x000000010a3a6522 VMError::report_and_die() + 1016
12 libjvm.dylib 0x000000010a284816 JVM_handle_bsd_signal + 1131
13 libjvm.dylib 0x000000010a280a7b signalHandler(int, __siginfo*, void*) + 47
14 libsystem_platform.dylib 0x00007fff8754952a _sigtramp + 26
15 ??? 0x0000000000000001 0 + 1
16 libjvm.dylib 0x000000010a11d830 jni_ReleaseByteArrayElements + 124
17 libengineEngine.jnilib 0x000000012750e41b JNIEnv_::ReleaseByteArrayElements(_jbyteArray*, signed char*, int) + 75 (jni.h:1689)
18 libengineEngine.jnilib 0x000000012750e1f8 operator delete(void*) + 408 (engineJAVA_wrap.cxx:298)
19 libengineEngine.jnilib 0x000000012750f710 Java_engineJNI_delete_1VectorMol + 80 (engineJAVA_wrap.cxx:586)
20 ??? 0x000000010ad9e954 0 + 4477020500
21 ??? 0x000000010ad90c4d 0 + 4476963917
22 ??? 0x000000010ad90c4d 0 + 4476963917
23 ??? 0x000000010ad90c92 0 + 4476963986
24 ??? 0x000000010ad90c4d 0 + 4476963917
25 ??? 0x000000010ad90c4d 0 + 4476963917
26 ??? 0x000000010ad90c4d 0 + 4476963917
27 ??? 0x000000010ad90c4d 0 + 4476963917
28 ??? 0x000000010ad909d0 0 + 4476963280
29 ??? 0x000000010ad90c92 0 + 4476963986
30 ??? 0x000000010ad897a7 0 + 4476934055
31 libjvm.dylib 0x000000010a0eab0e JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) + 1710
32 libjvm.dylib 0x000000010a0eb29c JavaCalls::call_virtual(JavaValue*, KlassHandle, Symbol*, Symbol*, JavaCallArguments*, Thread*) + 356
33 libjvm.dylib 0x000000010a0eb448 JavaCalls::call_virtual(JavaValue*, Handle, KlassHandle, Symbol*, Symbol*, Thread*) + 74
34 libjvm.dylib 0x000000010a145965 thread_entry(JavaThread*, Thread*) + 124
35 libjvm.dylib 0x000000010a3612d3 JavaThread::thread_main_inner() + 155
36 libjvm.dylib 0x000000010a3629ce JavaThread::run() + 450
37 libjvm.dylib 0x000000010a28343a java_start(Thread*) + 246
38 libsystem_pthread.dylib 0x00007fff98e6d99d _pthread_body + 131
39 libsystem_pthread.dylib 0x00007fff98e6d91a _pthread_start + 168
40 libsystem_pthread.dylib 0x00007fff98e6b351 thread_start + 13
Edit:
I found that if I comment out all my .delete() calls (SWIG generated method) in my Java code, then I get a different error:
# SIGILL (0x4) at pc=0x00007fff95c7379f, pid=85146, tid=80651
#
# JRE version: Java(TM) SE Runtime Environment (8.0_60-b27) (build 1.8.0_60-b27)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.60-b23 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [libsystem_c.dylib+0x5e79f] __abort+0xb1
and SIGILL is a new one to me...
I tried making a game in cocos 2dx. It is working perfectly fine in landscape mode. I even checked it on various devices. But when I switch to portrait mode the sprites and nodes in every scene are in different positions and some aren't even visible. I am setting everything relative to the screen width and height. For example:
backgroundSprite->setPosition(Point(visibleSize.width/2 +origin.x , visibleSize.height/2 +origin.y));
Plus to change to portrait mode, on Xcode, I clicked on the project name, went to the general tab and changed from Landscape Left and Landscape right to Portrait. When I tried to change to portrait mode in the method in the cocos.org page basically editing RootViewController.mm by replacing
return UIInterfaceOrientationMaskAllButUpsideDown;
with
return UIInterfaceOrientationMaskPortrait;
the Xcode simulator still crashed and gave me this error
2016-02-05 07:59:25.490 CircleGame-mobile[3192:39201] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [RootViewController shouldAutorotate] is returning YES'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110116e65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010fae8deb objc_exception_throw + 48
2 CoreFoundation 0x0000000110116d9d +[NSException raise:format:] + 205
3 UIKit 0x000000010db8f52b -[UIViewController __supportedInterfaceOrientations] + 903
4 UIKit 0x000000010db7dcd7 -[UIViewController _preferredInterfaceOrientationGivenStatusBarAndDeviceAndOrientation:] + 90
5 UIKit 0x000000010da4854c -[UIWindow setRootViewController:] + 111
6 CircleGame-mobile 0x000000010c3d8563 -[AppController application:didFinishLaunchingWithOptions:] + 883
7 UIKit 0x000000010d9d11f1 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 272
8 UIKit 0x000000010d9d2397 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3415
9 UIKit 0x000000010d9d8cc6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1760
10 UIKit 0x000000010d9d5e7b -[UIApplication workspaceDidEndTransaction:] + 188
11 FrontBoardServices 0x0000000112673754 -[FBSSerialQueue _performNext] + 192
12 FrontBoardServices 0x0000000112673ac2 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
13 CoreFoundation 0x0000000110042a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
14 CoreFoundation 0x000000011003895c __CFRunLoopDoSources0 + 556
15 CoreFoundation 0x0000000110037e13 __CFRunLoopRun + 867
16 CoreFoundation 0x0000000110037828 CFRunLoopRunSpecific + 488
17 UIKit 0x000000010d9d57cd -[UIApplication _run] + 402
18 UIKit 0x000000010d9da610 UIApplicationMain + 171
19 CircleGame-mobile 0x000000010c3ec934 main + 100
20 libdyld.dylib 0x00000001105fa92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I have an application in portrait mode.
1) in general settings you need to uncheck landscape and leave portrait only.
2) in info.plist "Supported interface orientations" you have to have Portrait (bottom home button).
3) in AppController.mm in supportedInterfaceOrientationsForWindow return just UIInterfaceOrientationMaskPortrait.
4) also in AppDelegate.cpp in applicationDidFinishLaunching:
remember to use setDesignResolutionSize with portrait dimensions, for example 960x640.
I have a bunch of QWebViews rendered onto a widget. There comes a point at which I start getting the error QThread::start: Failed to create thread (The access code is invalid.). Looking at the Qt source, it appears that _beginthreadex is returning a null handle and errno is ERROR_INVALID_ACCESS, but I have no idea why.
Here is the backtrace at the printing of the error:
0 qErrnoWarning qglobal.cpp 2451 0x69ccdd3c
1 QThread::start qthread_win.cpp 469 0x69cd5831
2 QThreadPoolPrivate::tryStart qthreadpool.cpp 203 0x69ccc3f5
3 QThreadPool::start qthreadpool.cpp 474 0x69cccdf4
4 QHostInfoLookupManager::work qhostinfo.cpp 633 0x6cb9b071
5 QHostInfoLookupManager::scheduleLookup qhostinfo.cpp 652 0x6cb9b143
6 QHostInfo::lookupHost qhostinfo.cpp 202 0x6cb9a220
7 qt_qhostinfo_lookup qhostinfo.cpp 722 0x6cb9b4b6
8 QAbstractSocket::connectToHostImplementation qabstractsocket.cpp 1427 0x6cbb17f5
9 QAbstractSocket::qt_static_metacall moc_qabstractsocket.cpp 166 0x6cbb4925
10 QMetaMethod::invoke qmetaobject.cpp 1664 0x69dc784f
11 QMetaObject::invokeMethod qmetaobject.cpp 1179 0x69dc6d6b
12 QMetaObject::invokeMethod qobjectdefs.h 418 0x6cd361dd
13 QAbstractSocket::connectToHost qabstractsocket.cpp 1342 0x6cbb13b3
14 QSslSocket::connectToHostImplementation qsslsocket.cpp 1744 0x6cbc7340
15 QSslSocket::qt_static_metacall moc_qsslsocket.cpp 91 0x6cbc93cf
16 QMetaMethod::invoke qmetaobject.cpp 1664 0x69dc784f
17 QMetaObject::invokeMethod qmetaobject.cpp 1179 0x69dc6d6b
18 QMetaObject::invokeMethod qobjectdefs.h 418 0x6cd361dd
19 QAbstractSocket::connectToHost qabstractsocket.cpp 1342 0x6cbb13b3
20 QSslSocket::connectToHostEncrypted qsslsocket.cpp 422 0x6cbc55e1
21 QHttpNetworkConnectionChannel::ensureConnection qhttpnetworkconnectionchannel.cpp 607 0x6cb6191f
22 QHttpNetworkConnectionPrivate::_q_startNextRequest qhttpnetworkconnection.cpp 862 0x6cb5e92c
23 QHttpNetworkConnectionPrivate::queueRequest qhttpnetworkconnection.cpp 501 0x6cb5c57d
24 QHttpNetworkConnection::sendRequest qhttpnetworkconnection.cpp 931 0x6cb5edf2
25 QHttpThreadDelegate::startRequest qhttpthreaddelegate.cpp 291 0x6cb8912a
26 QHttpThreadDelegate::qt_static_metacall moc_qhttpthreaddelegate_p.cpp 113 0x6cbd147c
27 QMetaCallEvent::placeMetaCall qobject.cpp 525 0x69dcf91c
28 QObject::event qobject.cpp 1195 0x69dd08db
29 QApplicationPrivate::notify_helper qapplication.cpp 4551 0x2582f44
30 QApplication::notify qapplication.cpp 3933 0x25808b7
31 QCoreApplication::notifyInternal qcoreapplication.cpp 915 0x69dc0dc6
32 QCoreApplication::sendEvent qcoreapplication.h 231 0x69e35185
33 QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp 1539 0x69dc1d2a
34 qt_internal_proc qeventdispatcher_win.cpp 496 0x69de2590
35 USER32!OffsetRect C:\Windows\syswow64\user32.dll 0 0x74cc62fa
36 ?? 0 0x152404
37 ?? 0 0x401
38 ?? 0
The code at the call looks like:
d->handle = (Qt::HANDLE) _beginthreadex(NULL, d->stackSize, QThreadPrivate::start, //d->stackSize is 0
this, CREATE_SUSPENDED, &(d->id));
if (!d->handle) {
qErrnoWarning(errno, "QThread::start: Failed to create thread");
d->running = false;
d->finished = true;
return;
}
Why is this happening and how do I fix it?
EDIT: also of note, there are exactly 500 threads at the point in which this breaks.
There's a good chance you've run out of free address space in your process (for thread stacks) after creating 500 threads. On 32-bit Windows, processes only get 2GB of address space by default (the upper half of the address space being reserved for the kernel). 500 1MB thread stacks (the default size, Qt may go higher or lower) plus all the other allocations your process makes could easily be using that up.
See this Old New Thing article for more.
Possible fixes:
If you know your QThreads don't need very big stacks, you can call QThread::setStackSize() to set a smaller size before starting the thread.
Consider using a thread pool and/or just reducing the number of concurrent threads you start. It's unlikely that you have enough CPU cores to make 500+ threads productive.
Use the Windows /3GB switch and make your application LARGE ADDRESS AWARE to get 3GB of user-mode address space.
Go 64-bit (for 63 bits of user-mode address space).
I am following a tutorial for a word processor for my QT module at uni.
It has asked me to put set this attribute:
MainWindow::setAttribute(Qt::WA_DeleteOnClose);
the problem comes when i run the application it causes an error saying that the application has closed unexpectedly.
Also it asked me to make a actionExit action and add to the file toolbar, which doesnt show, i am guessing that it is due to the fact that i am writing it on OSx and the exit/quit is taken care for you with the cmd+Q shortcut.
I was wondering if anyone could shed some light on this problem for me so that i know for future reference. if needed i can post the tutorial + source code.
Thanks
edit: backtrace from the debugger(hope this is correct)
0 __pthread_kill 0 0x7fff8eaff212
1 pthread_kill 0 0x7fff86f7eaf4
2 abort 0 0x7fff86fc2dce
3 free 0 0x7fff86f96959
4 MainWindow::~MainWindow mainwindow.cpp 22 0x100002cff
5 QObject::event 0 0x100e48906
6 QWidget::event 0 0x1000ecd5e
7 QMainWindow::event 0 0x10049cadb
8 QApplicationPrivate::notify_helper 0 0x10009593d
9 QApplication::notify 0 0x10009bdc4
10 QCoreApplication::notifyInternal 0 0x100e3417c
11 QCoreApplicationPrivate::sendPostedEvents 0 0x100e355a0
12 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 0 0x7fff90925101
13 __CFRunLoopDoSources0 0 0x7fff90924a25
14 __CFRunLoopRun 0 0x7fff90947dc5
15 CFRunLoopRunSpecific 0 0x7fff909476b2
16 RunCurrentEventLoopInMode 0 0x7fff8d0f60a4
17 ReceiveNextEventCommon 0 0x7fff8d0f5d84
18 BlockUntilNextEventMatchingListInMode 0 0x7fff8d0f5cd3
19 _DPSNextEvent 0 0x7fff91a00613
20 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] 0 0x7fff919ffed2
... <More>
Is your MainWindow object declared on the stack, by any chance? If so, then DeleteOnClose is not a good idea, simply because deleting an object that is on the stack is an error.