angr / angr-management

The official angr GUI.
BSD 2-Clause "Simplified" License
864 stars 108 forks source link

Attempting to decompile a function crashes angr management on macOS #1174

Open twizmwazin opened 4 months ago

twizmwazin commented 4 months ago

Description

Seems rather deep in qt and not necessarily our fault. We're a point release behind on Qt so its possible that this could remedy the issue.

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndexedSubscript:]: index 0 beyond bounds for empty array'
*** First throw call stack:
(
        0   CoreFoundation                      0x0000000186b58540 __exceptionPreprocess + 176
        1   libobjc.A.dylib                     0x0000000186649eb4 objc_exception_throw + 60
        2   CoreFoundation                      0x0000000186aceca0 -[__NSCFString hasSuffix:] + 0
        3   libqcocoa.dylib                     0x000000013b32a044 _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 274796
        4   libqcocoa.dylib                     0x000000013b32a0c8 _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 274928
        5   libqcocoa.dylib                     0x000000013b328688 _ZN20QCocoaSystemTrayIcon13emitActivatedEv + 268208
        6   QtWidgets                           0x00000001382c11a8 _ZN9QListView16selectionChangedERK14QItemSelectionS2_ + 204
        7   QtCore                              0x00000001292a348c _ZN11QMetaObject8activateEP7QObjectPKS_iPPv + 3808
        8   QtCore                              0x0000000129469e44 _ZN19QItemSelectionModel20emitSelectionChangedERK14QItemSelectionS2_ + 216
        9   QtCore                              0x0000000129469a2c _ZN19QItemSelectionModel6selectERK14QItemSelection6QFlagsINS_13SelectionFlagEE + 636
        10  QtCore                              0x000000012946970c _ZN19QItemSelectionModel6selectERK11QModelIndex6QFlagsINS_13SelectionFlagEE + 68
        11  QtCore                              0x000000012946a8cc _ZN19QItemSelectionModel15setCurrentIndexERK11QModelIndex6QFlagsINS_13SelectionFlagEE + 260
        12  QtWidgets                           0x000000013811f338 _ZNK9QComboBox5countEv + 828
        13  QtWidgets                           0x00000001381228b4 _ZN9QComboBoxC1ER16QComboBoxPrivateP7QWidget + 2412
        14  QtCore                              0x00000001292a3224 _ZN11QMetaObject8activateEP7QObjectPKS_iPPv + 3192
        15  QtCore                              0x0000000129452944 _ZN18QAbstractItemModel13endInsertRowsEv + 200
        16  QtGui                               0x000000012e2971a8 _ZN18QStandardItemModel11itemChangedEP13QStandardItem + 844
        17  QtWidgets                           0x0000000138125e38 _ZN9QComboBox11insertItemsEiRK5QListI7QStringE + 340
        18  QtWidgets.abi3.so                   0x000000012f8a990c _ZL26Sbk_QComboBoxFunc_addItemsP7_objectS0_ + 156
        19  Python                              0x00000001059f2170 _PyEval_EvalFrameDefault + 47096
        20  Python                              0x0000000105abd508 method_vectorcall.llvm.6692489560813170657 + 184
        21  Python                              0x00000001059f3040 _PyEval_EvalFrameDefault + 50888
        22  Python                              0x0000000105abd508 method_vectorcall.llvm.6692489560813170657 + 184
        23  QtWidgets.abi3.so                   0x000000012f5d83f4 _ZN18QMainWindowWrapper5eventEP6QEvent + 224
        24  QtWidgets                           0x000000013800c594 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 272
        25  QtWidgets                           0x000000013800df18 _ZN12QApplication6notifyEP7QObjectP6QEvent + 3368
        26  QtCore                              0x0000000129259474 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent + 292
        27  QtCore                              0x000000012925a6fc _ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData + 1448
        28  libqcocoa.dylib                     0x000000013b2cacb0 qt_plugin_instance + 54476
        29  libqcocoa.dylib                     0x000000013b2cbd74 qt_plugin_instance + 58768
        30  CoreFoundation                      0x0000000186ae39dc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
        31  CoreFoundation                      0x0000000186ae3970 __CFRunLoopDoSource0 + 176
        32  CoreFoundation                      0x0000000186ae36e0 __CFRunLoopDoSources0 + 244
        33  CoreFoundation                      0x0000000186ae22d0 __CFRunLoopRun + 828
        34  CoreFoundation                      0x0000000186ae193c CFRunLoopRunSpecific + 608
        35  HIToolbox                           0x00000001910aa448 RunCurrentEventLoopInMode + 292
        36  HIToolbox                           0x00000001910aa0d8 ReceiveNextEventCommon + 220
        37  HIToolbox                           0x00000001910a9fdc _BlockUntilNextEventMatchingListInModeWithFilter + 76
        38  AppKit                              0x000000018a2c0ed0 _DPSNextEvent + 660
        39  AppKit                              0x000000018aaabeec -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
        40  AppKit                              0x000000018a4f31e8 -[NSApplication _doModalLoop:peek:] + 216
        41  AppKit                              0x000000018a6fc1b8 __33-[NSApplication runModalSession:]_block_invoke_2 + 88
        42  AppKit                              0x000000018a6fc144 __33-[NSApplication runModalSession:]_block_invoke + 112
        43  AppKit                              0x000000018a4f1968 _NSTryRunModal + 100
        44  AppKit                              0x000000018a6fc014 -[NSApplication runModalSession:] + 148
        45  libqcocoa.dylib                     0x000000013b2c9854 qt_plugin_instance + 49264
        46  QtCore                              0x0000000129263160 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 540
        47  QtCore                              0x0000000129259b00 _ZN16QCoreApplication4execEv + 112
        48  QtWidgets.abi3.so                   0x000000012f96b2d8 _ZL25Sbk_QApplicationFunc_execP7_object + 60
        49  Python                              0x0000000105afaea8 cfunction_vectorcall_NOARGS.llvm.18055502890063263532 + 104
        50  Python                              0x00000001059f147c _PyEval_EvalFrameDefault + 43780
        51  Python                              0x0000000105a3feec PyEval_EvalCode + 184
        52  Python                              0x00000001059a3180 run_eval_code_obj.llvm.2122853570073706732 + 88
        53  Python                              0x0000000105a06d74 run_mod.llvm.2122853570073706732 + 132
        54  Python                              0x0000000105a06b20 pyrun_file + 148
        55  Python                              0x0000000105b230b8 _PyRun_SimpleFileObject + 288
        56  Python                              0x0000000105b22f04 _PyRun_AnyFileObject + 232
        57  Python                              0x0000000105a81f18 pymain_run_file_obj + 220
        58  Python                              0x0000000105b4bd94 pymain_run_file + 72
        59  Python                              0x0000000105b4b7c4 Py_RunMain + 860
        60  Python                              0x0000000105a81afc Py_BytesMain + 40
        61  dyld                                0x00000001866850e0 start + 2360
)
libc++abi: terminating due to uncaught exception of type NSException
zsh: abort      python start.py

Steps to reproduce the bug

Load binary, select a function, fit F5

Environment

macOS running on an m3 max, installed from pip or nightly build, pyside6 6.6.1

Additional context

No response

mborgerson commented 4 months ago

Wasn't able to reproduce this crash on an M1 mac mini running Sonoma 14.3.1 with PySide6 6.6.1 when installed from source or from the nightly build

twizmwazin commented 4 months ago

When I filed the issue I was using 14.3, I upgraded to 14.3.1 and it is still reproducible, so it might be something specific to my setup that is causing this.

61bcdefg commented 4 months ago

had the same problem

61bcdefg commented 4 months ago

This is probably not an issue of angr-management, as it seems to have been fixed after I updated PySide6 to 6.6.2

twizmwazin commented 4 months ago

Can confirm that this is fixed with PySide 6.6.2. Will leave open until we are upgraded to 6.6.2. If you are trying to install 6.6.2, install the pyqodeng and qtconsole branches from this pr, and reinstall shiboken6==6.6.2.