Recently, I have created a simple python app with a GUI implemented with the PyQt5
library. I have tested the app itself multiple times and everything works fine. However, after I tried to package that as an executable using pyinstaller
, running the resultant executable doesn't create the GUI and instead leads to segmentation fault: 11
. I read that this error code means that the program lacks access to a memory address that it is supposed to be able to access, but I have no idea why.
How can I tackle this?
Here's part of the crash report:
Process: cli [12548]Path: /Users/USER/Documents/*/cliIdentifier: cliVersion: ???Code Type: X86-64 (Native)Parent Process: bash [11625]Responsible: Terminal [47976]User ID: 501Date/Time: 2021-03-29 12:36:39.423 +0800OS Version: Mac OS X 10.15.5 (19F101)Report Version: 12Anonymous UUID: 855A3445-44EF-6596-8FC5-13FFACDFC8D8Sleep/Wake UUID: 0B342A31-57D9-44C6-8B29-7CA1D7E3E56BTime Awake Since Boot: 1200000 secondsTime Since Wake: 2800 secondsSystem Integrity Protection: enabledCrashed Thread: 0 Dispatch queue: com.apple.main-threadException Type: EXC_BAD_ACCESS (SIGSEGV)Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000010Exception Note: EXC_CORPSE_NOTIFYTermination Signal: Segmentation fault: 11Termination Reason: Namespace SIGNAL, Code 0xbTerminating Process: exc handler [12548]VM Regions Near 0x10:--> __TEXT 0000000100a49000-0000000100a50000 [ 28K] r-x/r-x SM=COW /Users/USER/Documents/*Thread 0 Crashed:: Dispatch queue: com.apple.main-thread0 com.apple.CoreFoundation 0x00007fff324d1488 CFBundleCopyBundleURL + 91 QtCore 0x0000000102b14470 QLibraryInfo::location(QLibraryInfo::LibraryLocation) + 13282 QtCore 0x0000000102b146cd QLibraryInfo::location(QLibraryInfo::LibraryLocation) + 19333 QtCore 0x0000000102cfa494 QCoreApplication::libraryPathsLocked() + 15244 QtCore 0x0000000102cf657b QCoreApplication::libraryPaths() + 435 QtCore 0x0000000102ce50a4 QFactoryLoader::update() + 366 QtCore 0x0000000102ce69c0 QFactoryLoader::QFactoryLoader(char const*, QString const&, Qt::CaseSensitivity) + 2247 QtGui 0x000000010249db3c QGlobalStatic<QFactoryLoader, (anonymous namespace)::Q_QGS_loader::innerFunction(), (anonymous namespace)::Q_QGS_loader::guard>::operator()() + 1728 QtGui 0x000000010249def1 QPlatformIntegrationFactory::keys(QString const&) + 7859 QtGui 0x00000001024aae5a QGuiApplicationPrivate::createPlatformIntegration() + 169010 QtGui 0x00000001024ac3fb QGuiApplicationPrivate::createEventDispatcher() + 2711 QtCore 0x0000000102cf61af QCoreApplicationPrivate::init() + 159912 QtGui 0x00000001024a6b59 QGuiApplicationPrivate::init() + 5713 QtWidgets 0x0000000101e4cada QApplicationPrivate::init() + 2614 QtWidgets.abi3.so 0x0000000101a1537b init_type_QApplication(_sipSimpleWrapper*, _object*, _object*, _object**, _object**, _object**) + 17115 sip.cpython-37m-darwin.so 0x00000001031c39cb sipSimpleWrapper_init + 20316 Python 0x00000001010a1199 type_call + 29717 Python 0x0000000101055d81 _PyObject_FastCallKeywords + 43318 Python 0x0000000101115ed4 call_function + 42019 Python 0x0000000101112fdd _PyEval_EvalFrameDefault + 2518120 Python 0x00000001010563a0 function_code_fastcall + 12821 Python 0x0000000101116012 call_function + 73822 Python 0x000000010111307e _PyEval_EvalFrameDefault + 2534223 Python 0x0000000101116b63 _PyEval_EvalCodeWithName + 246724 Python 0x000000010110cca4 PyEval_EvalCode + 10025 Python 0x000000010110a20d builtin_exec + 55726 Python 0x0000000101056a5e _PyMethodDef_RawFastCallKeywords + 43027 Python 0x0000000101055f6a _PyCFunction_FastCallKeywords + 4228 Python 0x0000000101116004 call_function + 72429 Python 0x000000010111307e _PyEval_EvalFrameDefault + 2534230 Python 0x00000001010563a0 function_code_fastcall + 12831 Python 0x0000000101116012 call_function + 73832 Python 0x0000000101112fc3 _PyEval_EvalFrameDefault + 2515533 Python 0x00000001010563a0 function_code_fastcall + 12834 Python 0x0000000101116012 call_function + 73835 Python 0x000000010111307e _PyEval_EvalFrameDefault + 2534236 Python 0x00000001010563a0 function_code_fastcall + 12837 Python 0x0000000101116012 call_function + 73838 Python 0x000000010111307e _PyEval_EvalFrameDefault + 2534239 Python 0x00000001010563a0 function_code_fastcall + 12840 Python 0x0000000101055994 _PyFunction_FastCallDict + 14841 Python 0x0000000101057abc object_vacall + 31642 Python 0x0000000101057bb1 _PyObject_CallMethodIdObjArgs + 17743 Python 0x000000010113518f PyImport_ImportModuleLevelObject + 153544 Python 0x0000000101111955 _PyEval_EvalFrameDefault + 1941345 Python 0x0000000101116b63 _PyEval_EvalCodeWithName + 246746 Python 0x000000010110cca4 PyEval_EvalCode + 10047 cli 0x0000000100a4b1fb 0x100a49000 + 869948 cli 0x0000000100a4b60c 0x100a49000 + 974049 cli 0x0000000100a49dc4 0x100a49000 + 3524Thread 1:0 libsystem_pthread.dylib 0x00007fff6c770b68 start_wqthread + 0Thread 2:0 libsystem_pthread.dylib 0x00007fff6c770b68 start_wqthread + 0Thread 3:0 libsystem_kernel.dylib 0x00007fff6c6b4882 __psynch_cvwait + 101 libsystem_pthread.dylib 0x00007fff6c775425 _pthread_cond_wait + 6982 libopenblas.0.dylib 0x000000010643a21f blas_thread_server + 2073 libsystem_pthread.dylib 0x00007fff6c775109 _pthread_start + 1484 libsystem_pthread.dylib 0x00007fff6c770b8b thread_start + 15Thread 0 crashed with X86 Thread State (64-bit): rax: 0xbd8b726b2745000a rbx: 0x0000000000000000 rcx: 0x0000000000000000 rdx: 0x00007fff6b3e0448 rdi: 0x0000000000000000 rsi: 0x0000000000000cfa rbp: 0x00007ffeef1b3dd0 rsp: 0x00007ffeef1b3dc0 r8: 0x0000800000000040 r9: 0x0000000000000081 r10: 0x00007fe5cac00000 r11: 0x00007fe5cacd3ad0 r12: 0x00007fe5cacd3480 r13: 0x000000000000008d r14: 0x0000000000000000 r15: 0x00007fe5cacd0c10 rip: 0x00007fff324d1488 rfl: 0x0000000000010246 cr2: 0x0000000000000010Logical CPU: 0Error Code: 0x00000004 (no mapping for user data read)Trap Number: 14