Vector35/snippets

Copy-pasting to snippet editor crashing whole BinaryNinja process.

Closed this issue · 2 comments

Hi, i've got persistent crash when trying to paste text in snippet editor.
Managed to reproduce it only on macOS.

BinaryNinja version: 4.1.5071-dev Personal (41729337)
OS: macOS
OS version: 14.1

Steps to reproduce:

  1. Open Binary Ninja on macOS
  2. Open snippet editor
  3. Paste 50+ lines of text
  4. BN is crashed

Quick demo:
output

Here is backtrace of falling thread:

(lldb) thread backtrace
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x0000000188c6111c libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x0000000188c98cc0 libsystem_pthread.dylib`pthread_kill + 288
    frame #2: 0x0000000188ba8a40 libsystem_c.dylib`abort + 180
    frame #3: 0x00000001148c71f8 Python`fatal_error_exit + 16
    frame #4: 0x00000001148c7054 Python`fatal_error + 44
    frame #5: 0x00000001148ca044 Python`_Py_FatalErrorFunc + 56
    frame #6: 0x00000001147a9558 Python`none_dealloc + 28
    frame #7: 0x000000011486bcc4 Python`_PyEval_EvalFrameDefault + 25712
    frame #8: 0x0000000114863fc4 Python`_PyEval_Vector + 360
    frame #9: 0x0000000114740fa0 Python`method_vectorcall + 288
    frame #10: 0x000000011ea02198 QtGui.abi3.so`QSyntaxHighlighterWrapper::highlightBlock(QString const&) + 200
    frame #11: 0x0000000106695ce8 QtGui`QSyntaxHighlighterPrivate::reformatBlock(QTextBlock const&) + 128
    frame #12: 0x0000000106695c00 QtGui`QSyntaxHighlighterPrivate::reformatBlocks(int, int, int) + 360
    frame #13: 0x0000000104dff8f8 QtCore`void doActivate<false>(QObject*, int, void**) + 1396
    frame #14: 0x00000001066abbf4 QtGui`QTextDocument::contentsChange(int, int, int) + 76
    frame #15: 0x00000001066b0940 QtGui`QTextDocumentPrivate::finishEdit() + 124
    frame #16: 0x000000010669d91c QtGui`QTextCursor::insertFragment(QTextDocumentFragment const&) + 184
    frame #17: 0x0000000105f6c768 QtWidgets`QWidgetTextControl::insertFromMimeData(QMimeData const*) + 916
    frame #18: 0x0000000105f660a0 QtWidgets`QWidgetTextControlPrivate::keyPressEvent(QKeyEvent*) + 1596
    frame #19: 0x0000000105f65184 QtWidgets`QWidgetTextControl::processEvent(QEvent*, QPointF const&, QWidget*) + 108
    frame #20: 0x0000000105f3d204 QtWidgets`QPlainTextEdit::keyPressEvent(QKeyEvent*) + 476
    frame #21: 0x000000012009181c QtWidgets.abi3.so`Sbk_QPlainTextEditFunc_keyPressEvent(_object*, _object*) + 160
    frame #22: 0x00000001147a5104 Python`cfunction_vectorcall_O + 100
    frame #23: 0x00000001148731fc Python`call_function + 132
    frame #24: 0x000000011486b52c Python`_PyEval_EvalFrameDefault + 23768
    frame #25: 0x0000000114863fc4 Python`_PyEval_Vector + 360
    frame #26: 0x0000000114740fa0 Python`method_vectorcall + 288
    frame #27: 0x0000000120088424 QtWidgets.abi3.so`QPlainTextEditWrapper::keyPressEvent(QKeyEvent*) + 216
    frame #28: 0x0000000105db782c QtWidgets`QWidget::event(QEvent*) + 488
    frame #29: 0x0000000105e3aa98 QtWidgets`QFrame::event(QEvent*) + 56
    frame #30: 0x0000000105f3cbdc QtWidgets`QPlainTextEdit::event(QEvent*) + 632
    frame #31: 0x0000000105d6f16c QtWidgets`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 272
    frame #32: 0x0000000105d701c0 QtWidgets`QApplication::notify(QObject*, QEvent*) + 1036
    frame #33: 0x0000000104db5774 QtCore`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 292
    frame #34: 0x0000000105dcb248 QtWidgets`QWidgetWindow::event(QEvent*) + 180
    frame #35: 0x0000000105d6f16c QtWidgets`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 272
    frame #36: 0x0000000105d6ffac QtWidgets`QApplication::notify(QObject*, QEvent*) + 504
    frame #37: 0x0000000104db5774 QtCore`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 292
    frame #38: 0x000000010648bbd8 QtGui`QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) + 252
    frame #39: 0x00000001064e71a4 QtGui`QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 408
    frame #40: 0x00000001064e6d90 QtGui`QWindowSystemInterface::flushWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 524
    frame #41: 0x000000010430dcbc libqcocoa.dylib`-[QNSView(Keys) handleKeyEvent:] + 1832
    frame #42: 0x000000010430ebb4 libqcocoa.dylib`-[QNSView(Keys) keyDown:] + 92
    frame #43: 0x000000018c67a690 AppKit`-[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 480
    frame #44: 0x000000018c67a2dc AppKit`-[NSWindow(NSEventRouting) sendEvent:] + 284
    frame #45: 0x00000001043188dc libqcocoa.dylib`-[QNSPanel sendEvent:] + 860
    frame #46: 0x000000018cd23f00 AppKit`-[NSApplication(NSEventRouting) sendEvent:] + 1604
    frame #47: 0x00000001042b7510 libqcocoa.dylib`-[QNSApplication sendEvent:] + 76
    frame #48: 0x000000018c97609c AppKit`-[NSApplication _handleEvent:] + 60
    frame #49: 0x000000018c5420b0 AppKit`-[NSApplication run] + 512
    frame #50: 0x00000001042c35b8 libqcocoa.dylib`QCocoaEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 2124
    frame #51: 0x0000000104dbf458 QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 540
    frame #52: 0x0000000104db5e00 QtCore`QCoreApplication::exec() + 112
    frame #53: 0x00000001028a54b0 binaryninja`___lldb_unnamed_symbol6059 + 9952
    frame #54: 0x000000018891d0e0 dyld`start + 2360

Sorry, probably duplicate of #50

Might not be, I'll symbolicate the stack trace later and see, thanks for the report.