Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cutter freezes when scrolling disassembly #3328

Open
1 task done
praschke opened this issue Apr 4, 2024 · 5 comments
Open
1 task done

Cutter freezes when scrolling disassembly #3328

praschke opened this issue Apr 4, 2024 · 5 comments
Assignees
Labels
BUG rizin Needs changes into rizin codebase.

Comments

@praschke
Copy link

praschke commented Apr 4, 2024

Environment information

  • Operating System: Linux (NixOS)
  • Cutter version: 2.3.4
  • Obtained from:
    • Distribution repository
  • File format: PE32

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<false>(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<QEventLoop::ProcessEventsFlag>) () 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<QEventLoop::ProcessEventsFlag>) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6
#33 0x000075eef8389cd3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () 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
Copy link
Member

karliss commented Apr 4, 2024

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

@praschke
Copy link
Author

praschke commented Apr 4, 2024

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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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)(?<number>(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<false>(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<RefreshDeferrer::registerFor(CutterDockWidget*)::{lambda()#1}, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) ()
#18 0x000077a4c4fddd53 in void doActivate<false>(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<QEventLoop::ProcessEventsFlag>) () from /nix/store/2mcqdmp7kb8pfkibxsm10z3s94j80s6y-qtbase-6.6.3/lib/libQt6Core.so.6
#30 0x000077a4c4f89cd3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () 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 karliss added the rizin Needs changes into rizin codebase. label Apr 4, 2024
@karliss
Copy link
Member

karliss commented Apr 4, 2024

Ok this looks like combination of two problems:

@Rot127 Rot127 added the BUG label Apr 7, 2024
@Rot127
Copy link
Member

Rot127 commented Apr 7, 2024

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 Rot127 self-assigned this Apr 11, 2024
@Rot127
Copy link
Member

Rot127 commented Apr 19, 2024

@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 NixOS/nixpkgs#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('.'),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG rizin Needs changes into rizin codebase.
Projects
None yet
Development

No branches or pull requests

3 participants