rizinorg / cutter

Free and Open Source Reverse Engineering Platform powered by rizin
https://cutter.re
GNU General Public License v3.0
15.32k stars 1.14k forks source link

Cutter freezes when scrolling disassembly #3328

Open praschke opened 3 months ago

praschke commented 3 months ago

Environment information

Describe the bug

Scrolling too quickly in the disassembly freezes Cutter.

To Reproduce

Steps to reproduce the behavior:

  1. Open Cutter in a wayland session and analyze the attached binary.
  2. Click on Disassembly.
  3. Scroll vigorously.
  4. Cutter freezes.

Expected behavior

Cutter doesn't freeze.

Additional context

The freeze only occurs on Wayland. On Xwayland it functions normally.

backtrace: ``` #0 0x000075eef743697f in write () from /nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6 #1 0x000075eef73b877d in _IO_file_write@@GLIBC_2.2.5 () from /nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6 #2 0x000075eef73b6a44 in new_do_write () from /nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6 #3 0x000075eef73b8971 in __GI__IO_file_xsputn () from /nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6 #4 0x000075eef73abf4b in fputs () from /nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6 #5 0x000075eef936d0af in rz_vlog () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_util.so.0.7 #6 0x000075eef936d2e7 in rz_log () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_util.so.0.7 #7 0x000075eef9377e45 in print_pcre2_err () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_util.so.0.7 #8 0x000075eef9377f8c in rz_regex_new () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_util.so.0.7 #9 0x000075eef8959409 in subvar () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_parse.so.0.7 #10 0x000075eefa50f3a8 in ds_build_op_str () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_core.so.0.7 #11 0x000075eefa517902 in rz_core_print_disasm () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_core.so.0.7 #12 0x0000000000521392 in CutterCore::disassembleLines(unsigned long long, int) () #13 0x00000000006068ec in DisassemblyWidget::refreshDisasm(unsigned long long) () #14 0x0000000000607214 in DisassemblyWidget::scrollInstructions(int) () #15 0x000075eef83ddd53 in void doActivate(QObject*, int, void**) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #16 0x00000000004de28e in DisassemblyScrollArea::scrollLines(int) () #17 0x0000000000609cda in DisassemblyScrollArea::viewportEvent(QEvent*) () #18 0x000075eef837cabe in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #19 0x000075eef9592b31 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Widgets.so.6 #20 0x000075eef959ca05 in QApplication::notify(QObject*, QEvent*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Widgets.so.6 #21 0x000075eef837cd28 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #22 0x000075eef95fee2d in QWidgetWindow::handleWheelEvent(QWheelEvent*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Widgets.so.6 #23 0x000075eef9600296 in QWidgetWindow::event(QEvent*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Widgets.so.6 #24 0x000075eef9592b41 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Widgets.so.6 #25 0x000075eef837cd28 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #26 0x000075eef8bd38fa in QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::WheelEvent*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Gui.so.6 #27 0x000075eef8c33b7c in QWindowSystemInterface::sendWindowSystemEvents(QFlags) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Gui.so.6 #28 0x000075eef90cd8c0 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Gui.so.6 #29 0x000075eef6312744 in g_main_dispatch () from /nix/store/gkkabfk5kccd5j8fm1hlrb71pmpcbw1p-glib-2.78.4/lib/libglib-2.0.so.0 #30 0x000075eef6315797 in g_main_context_iterate_unlocked.isra () from /nix/store/gkkabfk5kccd5j8fm1hlrb71pmpcbw1p-glib-2.78.4/lib/libglib-2.0.so.0 #31 0x000075eef6315d8c in g_main_context_iteration () from /nix/store/gkkabfk5kccd5j8fm1hlrb71pmpcbw1p-glib-2.78.4/lib/libglib-2.0.so.0 #32 0x000075eef863a0cc in QEventDispatcherGlib::processEvents(QFlags) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #33 0x000075eef8389cd3 in QEventLoop::exec(QFlags) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #34 0x000075eef8385e56 in QCoreApplication::exec() () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #35 0x00000000004cad5e in main () ```

Attached file:

vpatch.zip

karliss commented 2 months ago

If you scroll at moderate speed do you see a bunch of warnings in the builtin console widget?

praschke commented 2 months ago
log: ``` ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '([re][0-9a-z][0-9a-z])\s*(\+|-)\s*((0x)?[0-9a-f]+h?)' failed at 0: bad JIT option ERROR: Regex compilation for '[[0-9;]*m' failed at 0: bad JIT option ERROR: Regex compilation for '([[0-9;]*m)(?(0x[a-fA-F0-9]+)|\d+)' failed at 0: bad JIT option ERROR: Regex compilation for '(^[\d{1,3}mlea[0m.+)' failed at 0: bad JIT option Oops invalid escape char Oops invalid escape char Oops invalid escape char Oops invalid escape char [...] ```

also now i'm not so sure that wayland is related, i'm now getting freezes in X when trying to open the same executable again.

backtrace: ``` #0 0x000077a4c411897f in write () from /nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6 #1 0x000077a4c409a77d in _IO_file_write@@GLIBC_2.2.5 () from /nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6 #2 0x000077a4c4098a44 in new_do_write () from /nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6 #3 0x000077a4c409a971 in __GI__IO_file_xsputn () from /nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6 #4 0x000077a4c408df4b in fputs () from /nix/store/1rm6sr6ixxzipv5358x0cmaw8rs84g2j-glibc-2.38-44/lib/libc.so.6 #5 0x000077a4c6e960af in rz_vlog () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_util.so.0.7 #6 0x000077a4c6e962e7 in rz_log () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_util.so.0.7 #7 0x000077a4c6ea0e45 in print_pcre2_err () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_util.so.0.7 #8 0x000077a4c6ea0f8c in rz_regex_new () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_util.so.0.7 #9 0x000077a4c5f85b5e in filter.isra () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_parse.so.0.7 #10 0x000077a4c5f86ccf in rz_parse_filter () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_parse.so.0.7 #11 0x000077a4c710f569 in ds_build_op_str () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_core.so.0.7 #12 0x000077a4c7117902 in rz_core_print_disasm () from /nix/store/1bwr5a2jinva4m5rzrbbhbzxpdbl1bk8-rizin-0.7.2/lib/librz_core.so.0.7 #13 0x0000000000521392 in CutterCore::disassembleLines(unsigned long long, int) () #14 0x00000000006068ec in DisassemblyWidget::refreshDisasm(unsigned long long) () #15 0x000077a4c4fddd53 in void doActivate(QObject*, int, void**) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #16 0x00000000004dd04f in RefreshDeferrer::refreshNow(void*) () #17 0x0000000000694df7 in QtPrivate::QCallableObject, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) () #18 0x000077a4c4fddd53 in void doActivate(QObject*, int, void**) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #19 0x00000000005922fa in MainWindow::setViewLayout(Cutter::CutterLayout const&) () #20 0x0000000000596720 in MainWindow::finalizeOpen() () #21 0x000077a4c4fcda34 in QObject::event(QEvent*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #22 0x000077a4c6192b41 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Widgets.so.6 #23 0x000077a4c4f7cd28 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #24 0x000077a4c4f80ab7 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #25 0x000077a4c523a6f3 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #26 0x000077a4c3112744 in g_main_dispatch () from /nix/store/gkkabfk5kccd5j8fm1hlrb71pmpcbw1p-glib-2.78.4/lib/libglib-2.0.so.0 #27 0x000077a4c3115797 in g_main_context_iterate_unlocked.isra () from /nix/store/gkkabfk5kccd5j8fm1hlrb71pmpcbw1p-glib-2.78.4/lib/libglib-2.0.so.0 #28 0x000077a4c3115d8c in g_main_context_iteration () from /nix/store/gkkabfk5kccd5j8fm1hlrb71pmpcbw1p-glib-2.78.4/lib/libglib-2.0.so.0 #29 0x000077a4c523a0cc in QEventDispatcherGlib::processEvents(QFlags) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #30 0x000077a4c4f89cd3 in QEventLoop::exec(QFlags) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #31 0x000077a4c4f85e56 in QCoreApplication::exec() () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6 #32 0x00000000004cad5e in main () ``` ``` [...] ERROR: Regex compilation for '\s+' failed at 0: bad JIT option ERROR: Regex compilation for '\s+' failed at 0: bad JIT option ERROR: Regex compilation for '\s+' failed at 0: bad JIT option ERROR: Regex compilation for '\s+' failed at 0: bad JIT option ERROR: Regex compilation for '\s+' failed at 0: bad JIT option [x] Analyze all flags starting with sym. and entry0 (aa) [x] Analyze function calls [x] Analyze len bytes of instructions for references [x] Check for classes [x] Analyze local variables and arguments [x] Type matching analysis for all functions [x] Applied 57 FLIRT signatures via sigdb [x] Propagate noreturn information [x] Integrate dwarf function information. [x] Resolve pointers to data sections [x] Use -AA or aaaa to perform additional experimental analysis. ``` the application freezes there.
karliss commented 2 months ago

Ok this looks like combination of two problems:

Rot127 commented 2 months ago

I cannot reproduce it on Debian. And the PCRE2 and NixOS issues don't mention problems with JIT anywhere. This will need a little time until I have set up a NixOS VM. Also because we want to report this to the PCRE2 folks. But we could just disable JIT for NixOS as well.

Rot127 commented 2 months ago

@praschke Setting up NixOS takes pretty long for me (installing qt6/5 doesn't work and more). And I don't know unfortunately, when I will find time to take care of it.

So if you are willing, you can test the following patches, which disables JIT for the regex engine.

If they do work, it means NixOS has problems with the PCRE2 JIT as well. We shoud report this in https://github.com/NixOS/nixpkgs/issues/300056 in this case. And than see how they'd like to solve it.

Diffs

They are for rizin. Not for Cutter. So they need to be applied in the rizin submodule.

diff --git a/meson.build b/meson.build
index a8153a2ee5..787cbfae06 100644
--- a/meson.build
+++ b/meson.build
@@ -197,7 +197,7 @@ endif

 # Handle PCRE2
 cpu_jit_supported = [ 'aarch64', 'arm', 'mips', 'mips64', 'ppc', 'ppc64', 'riscv32', 'riscv64', 's390x', 'x86', 'x86_64' ]
-pcre2_jit_supported = target_machine.cpu_family() in cpu_jit_supported and cc.get_id() != 'tcc' and target_machine.system() != 'darwin'
+pcre2_jit_supported = false
 if pcre2_jit_supported
   add_project_arguments(['-DSUPPORTS_PCRE2_JIT'], language: 'c')
 endif
diff --git a/subprojects/packagefiles/pcre2/meson.build b/subprojects/packagefiles/pcre2/meson.build
index b40ea85740..f3ee7a02ed 100644
--- a/subprojects/packagefiles/pcre2/meson.build
+++ b/subprojects/packagefiles/pcre2/meson.build
@@ -60,18 +60,6 @@ cpu_jit_supported = [ 'aarch64', 'arm', 'mips', 'mips64', 'ppc', 'ppc64', 'riscv
 # tcc doesn't support the MSVC asm syntax PCRE2 uses (`__asm { ... }`).
 # Darwin kernel not as well, because of forbidden wx memory.
 # It is used in the JIT compiler code.
-if cc.get_id() != 'tcc' and target_machine.cpu_family() in cpu_jit_supported and target_machine.system() != 'darwin'
-  libpcre2_c_args += ['-DSUPPORT_JIT']
-  pcre2_files += ['src/pcre2_jit_compile.c']
-endif
-
-if target_machine.system() == 'openbsd'
-  # jit compilation fails with "no more memory" if wx allocations are allowed.
-  libpcre2_c_args += ['-DSLJIT_WX_EXECUTABLE_ALLOCATOR']
-elif target_machine.system() == 'netbsd'
-  # jit compilation fails with "no more memory" if wx allocations are allowed.
-  libpcre2_c_args += ['-DSLJIT_PROT_EXECUTABLE_ALLOCATOR']
-endif

 pcre2_includes = [
   include_directories('.'),