eteran / edb-debugger

edb is a cross-platform AArch32/x86/x86-64 debugger.
GNU General Public License v2.0
2.63k stars 321 forks source link

Debugging any process segfaults the process #862

Closed brndd closed 3 months ago

brndd commented 3 months ago

OS: Fedora 39, KDE Wayland, kernel 6.7.9 edb version: tried 1.4.0, 1.5.0 and master

Attempting to open any binary with edb causes the process to immediately segfault when resumed. When attaching to existing processes, edb seems to get detached from the process as soon as the process is resumed.

Not really sure how to troubleshoot this further.

Reproduction steps

  1. Open edb
  2. File->Open, browse some simple application like echo or nano
  3. Press Run to resume the application
  4. Application segfaults

When attaching to existing processes, debugging fails but the application doesn't seem to segfault.

Log output

Journal doesn't look to have anything interesting:

Mar 26 01:04:20 audit[1146806]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=1146806 comm="echo" exe="/usr/bin/echo" sig=5 res=1
Mar 26 01:04:20 audit: BPF prog-id=478 op=LOAD
Mar 26 01:04:20 audit: BPF prog-id=479 op=LOAD
Mar 26 01:04:20 audit: BPF prog-id=480 op=LOAD
Mar 26 01:04:20 systemd[1]: Started systemd-coredump@17-1146811-0.service - Process Core Dump (PID 1146811/UID 0).
Mar 26 01:04:20 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@17-1146811-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Mar 26 01:04:20 systemd-coredump[1146812]: Process 1146806 (echo) of user 1000 dumped core.

                                           Module echo from rpm coreutils-9.3-5.fc39.x86_64
                                           Stack trace of thread 1146806:
                                           #0  0x0000560bfa4a14e1 main (echo + 0x24e1)
                                           #1  0x00007ff95f99514a __libc_start_call_main (libc.so.6 + 0x2814a)
                                           #2  0x00007ff95f99520b __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x2820b)
                                           #3  0x0000560bfa4a2035 _start (echo + 0x3035)
                                           ELF object binary architecture: AMD x86-64
Mar 26 01:04:20 systemd[1]: systemd-coredump@17-1146811-0.service: Deactivated successfully.
Mar 26 01:04:20 audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@17-1146811-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Mar 26 01:04:21 audit: BPF prog-id=480 op=UNLOAD
Mar 26 01:04:21 audit: BPF prog-id=479 op=UNLOAD
Mar 26 01:04:21 audit: BPF prog-id=478 op=UNLOAD
Mar 26 01:04:21 abrt-server[1146822]: The crashed process was ptraced - not saving the crash
Mar 26 01:04:21 abrt-server[1146822]: 'post-create' on '/var/spool/abrt/ccpp-2024-03-26-03:04:21.250774-1146806' exited with 1
Mar 26 01:04:21 abrt-server[1146822]: Deleting problem directory '/var/spool/abrt/ccpp-2024-03-26-03:04:21.250774-1146806'

And neither does stdout for edb:

$ ./edb
setGrabPopup called with a parent, QtWaylandClient::QWaylandXdgSurface(0x12b8c70) which does not match the current topmost grabbing popup, QtWaylandClient::QWaylandXdgSurface(0x697970) According to the xdg-shell protocol, this is not allowed. The wayland QPA plugin is currently handling it by setting the parent to the topmost grabbing popup. Note, however, that this may cause positioning errors and popups closing unxpectedly because xdg-shell mandate that child popups close before parents
Unable to get signal info for thread 1146806 : PTRACE_GETSIGINFO failed: No such process
Unable to continue thread 1146806 : PTRACE_CONT failed: No such process
PTRACE_GETREGS failed: No such process
PTRACE_GETFPREGS failed: No such process
PTRACE_GETREGS failed: No such process
PTRACE_GETFPREGS failed: No such process
PTRACE_GETREGS failed: No such process
PTRACE_GETFPREGS failed: No such process
PTRACE_GETREGS failed: No such process
PTRACE_GETFPREGS failed: No such process
eteran commented 3 months ago

OK, let's start with the small stuff.

  1. are you able to use gdb?
  2. is it possible that SELinux is involved and causing a problem?
brndd commented 3 months ago

gdb looks to work fine. I can't get it to auto-pause at the main symbol like edb does, but both running new processes and attaching to existing ones, and then pausing and resuming them seems to work fine. I'm not getting any SELinux denials and tried with setenforce 0 too which made no difference.

With an already running process, here's what happens when building master in the debug configuration:

  1. Open some application (in this case, Kate)
  2. Open edb
  3. File > Attach into Kate
  4. Kate process gets suspended, edb attaches to it and displays disassembly and stack information etc.
  5. Press "Run" in edb to unsuspend Kate
  6. edb gets deattached from Kate, Kate continues running fine, edb stdout is filled with "No such process" errors from ptrace. No crash occurs.
eteran commented 3 months ago

This is both odd and interesting. I can't say that I've encountered that kind of issue before. Initially, I was wondering if somehow the setting of the initial breakpoint was the problem because looking at the debugee stack trace:

                                           Module echo from rpm coreutils-9.3-5.fc39.x86_64
                                           Stack trace of thread 1146806:
                                           #0  0x0000560bfa4a14e1 main (echo + 0x24e1)
                                           #1  0x00007ff95f99514a __libc_start_call_main (libc.so.6 + 0x2814a)
                                           #2  0x00007ff95f99520b __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x2820b)
                                           #3  0x0000560bfa4a2035 _start (echo + 0x3035)
                                           ELF object binary architecture: AMD x86-64

It seems like it broke in main itself.

But that wouldn't explain why edb gets detached from already running processes it tries to resume... Perhaps I have it backwards?

I'm currently thinking that for some reason resuming is detaching edb from the process. The process then hits the breakpoint, but there's no debugger attached anymore so it just crashes as if it hit an int3 in code naturally.

Here's an experiment we can do.

  1. Open some application (in this case, Kate)
  2. Open edb
  3. File > Attach into Kate
  4. Kate process gets suspended, edb attaches to it and displays disassembly and stack information etc.
  5. Put a breakpoint on some instruction just ahead of RIP. Maybe even the next instruction assuming you're not sitting on a jump
  6. Press "Run" in edb to unsuspend Kate

Expected outcome: edb detaches kate crashes

brndd commented 3 months ago

Ran that experiment, and yup -- the behaviour matched your expected outcome exactly. Kate crashed, and edb got detached.

Journal output including stacktrace below, in case you want to check it for clues (I don't see anything that looks useful).

edit: also, I forgot to mention the kernel I'm running. It's 6.7.9.

Kate crash journal output ``` Mar 26 15:40:52 systemd[1817]: Started app-org.kde.kate-8a278d8dc6bd402d86c6e90b88054794.scope - Kate - Advanced Text Editor. Mar 26 15:40:56 kwin_wayland[2990]: This plugin does not support raise() Mar 26 15:41:00 krunner[9102]: WARNING: discarding _NET_WM_PID 5 as invalid for X11 window - use specialized XCB_X11_TO_PID function! Mar 26 15:41:23 audit[1224982]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=1224982 comm="WaylandEventThr" exe="/usr/bin/kate" sig=5 res=1 Mar 26 15:41:23 audit: BPF prog-id=493 op=LOAD Mar 26 15:41:23 audit: BPF prog-id=494 op=LOAD Mar 26 15:41:23 audit: BPF prog-id=495 op=LOAD Mar 26 15:41:23 systemd[1]: Started systemd-coredump@21-1225059-0.service - Process Core Dump (PID 1225059/UID 0). Mar 26 15:41:23 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@21-1225059-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' Mar 26 15:41:23 systemd-coredump[1225060]: Process 1224982 (kate) of user 1000 dumped core. Module libvoikko.so.1 from rpm libvoikko-4.3.2-3.fc39.x86_64 Module sonnet_voikko.so from rpm kf5-sonnet-5.115.0-1.fc39.x86_64 Module libhunspell-1.7.so.0 from rpm hunspell-1.7.2-5.fc39.x86_64 Module sonnet_hunspell.so from rpm kf5-sonnet-5.115.0-1.fc39.x86_64 Module libhspell.so.0 from rpm hspell-1.4-19.fc39.x86_64 Module sonnet_hspell.so from rpm kf5-sonnet-5.115.0-1.fc39.x86_64 Module sonnet_aspell.so from rpm kf5-sonnet-5.115.0-1.fc39.x86_64 Module textfilterplugin.so from rpm kate-23.08.5-1.fc39.x86_64 Module tabswitcherplugin.so from rpm kate-23.08.5-1.fc39.x86_64 Module lspclientplugin.so from rpm kate-23.08.5-1.fc39.x86_64 Module katekonsoleplugin.so from rpm kate-23.08.5-1.fc39.x86_64 Module externaltoolsplugin.so from rpm kate-23.08.5-1.fc39.x86_64 Module libKF5Syndication.so.5 from rpm kf5-syndication-5.115.0-1.fc39.x86_64 Module libKF5Package.so.5 from rpm kf5-kpackage-5.115.0-1.fc39.x86_64 Module libKF5Attica.so.5 from rpm kf5-attica-5.115.0-1.fc39.x86_64 Module libKF5NewStuffCore.so.5 from rpm kf5-knewstuff-5.115.0-1.fc39.x86_64 Module libKF5NewStuff.so.5 from rpm kf5-knewstuff-5.115.0-1.fc39.x86_64 Module kateprojectplugin.so from rpm kate-23.08.5-1.fc39.x86_64 Module libQt5Concurrent.so.5 from rpm qt5-qtbase-5.15.12-5.fc39.x86_64 Module katesearchplugin.so from rpm kate-23.08.5-1.fc39.x86_64 Module katefiletreeplugin.so from rpm kate-23.08.5-1.fc39.x86_64 Module libwebpdemux.so.2 from rpm libwebp-1.3.2-2.fc39.x86_64 Module libwebpmux.so.3 from rpm libwebp-1.3.2-2.fc39.x86_64 Module libqwebp.so from rpm qt5-qtimageformats-5.15.12-1.fc39.x86_64 Module libqwbmp.so from rpm qt5-qtimageformats-5.15.12-1.fc39.x86_64 Module libjbig.so.2.1 from rpm jbigkit-2.1-26.fc39.x86_64 Module libLerc.so.4 from rpm liblerc-4.0.0-4.fc39.x86_64 Module libwebp.so.7 from rpm libwebp-1.3.2-2.fc39.x86_64 Module libtiff.so.5 from rpm libtiff-4.4.0-8.fc39.x86_64 Module libqtiff.so from rpm qt5-qtimageformats-5.15.12-1.fc39.x86_64 Module libqsvg.so from rpm qt5-qtsvg-5.15.12-1.fc39.x86_64 Module libmng.so.2 from rpm libmng-2.0.3-19.fc39.x86_64 Module libqmng.so from rpm qt5-qtimageformats-5.15.12-1.fc39.x86_64 Module libqjpeg.so from rpm qt5-qtbase-5.15.12-5.fc39.x86_64 Module libqjp2.so from rpm qt5-qtimageformats-5.15.12-1.fc39.x86_64 Module libqico.so from rpm qt5-qtbase-5.15.12-5.fc39.x86_64 Module libqicns.so from rpm qt5-qtimageformats-5.15.12-1.fc39.x86_64 Module libqheif.so from rpm qt-heif-image-plugin-0.3.4-1.fc39.x86_64 Module libqgif.so from rpm qt5-qtbase-5.15.12-5.fc39.x86_64 Module kimg_xcf.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module kimg_tga.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module kimg_rgb.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module liblcms2.so.2 from rpm lcms2-2.15-2.fc39.x86_64 Module libjasper.so.6 from rpm jasper-3.0.6-4.fc39.x86_64 Module libraw.so.23 from rpm LibRaw-0.21.2-2.fc39.x86_64 Module kimg_raw.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module kimg_ras.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module kimg_qoi.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module kimg_psd.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module kimg_pic.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module kimg_pcx.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module kimg_ora.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module kimg_kra.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module libjxl_threads.so.0.8 from rpm jpegxl-0.8.2-3.fc39.x86_64 Module kimg_jxl.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module libsharpyuv.so.0 from rpm libwebp-1.3.2-2.fc39.x86_64 Module libopenjp2.so.7 from rpm openjpeg2-2.5.2-1.fc39.x86_64 Module libjpeg.so.62 from rpm libjpeg-turbo-2.1.4-3.fc39.x86_64 Module libheif.so.1 from rpm libheif-1.17.5-1.fc39.x86_64 Module kimg_heif.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module kimg_hdr.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module libIlmThread-3_1.so.30 from rpm openexr-3.1.10-2.fc39.x86_64 Module libIex-3_1.so.30 from rpm openexr-3.1.10-2.fc39.x86_64 Module libImath-3_1.so.29 from rpm imath-3.1.10-1.fc39.x86_64 Module libOpenEXR-3_1.so.30 from rpm openexr-3.1.10-2.fc39.x86_64 Module kimg_exr.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module kimg_eps.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module libbrotlienc.so.1 from rpm brotli-1.1.0-1.fc39.x86_64 Module libvmaf.so.1 from rpm vmaf-2.3.0-6.fc39.x86_64 Module libjxl.so.0.8 from rpm jpegxl-0.8.2-3.fc39.x86_64 Module libaom.so.3 from rpm aom-3.8.0-1.fc39.x86_64 Module libSvtAv1Enc.so.1 from rpm svt-av1-1.4.1-3.fc39.x86_64 Module librav1e.so.0 from rpm rust-rav1e-0.7.1-1.fc39.x86_64 Module libdav1d.so.6 from rpm dav1d-1.2.1-2.fc39.x86_64 Module libavif.so.15 from rpm libavif-0.11.1-11.fc39.x86_64 Module kimg_avif.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module kimg_ani.so from rpm kf5-kimageformats-5.115.0-2.fc39.x86_64 Module libxdg-shell.so from rpm qt5-qtwayland-5.15.12-2.fc39.x86_64 Module libqsvgicon.so from rpm qt5-qtsvg-5.15.12-1.fc39.x86_64 Module libKF5Style.so.5 from rpm kf5-frameworkintegration-5.115.0-1.fc39.x86_64 Module libbreezecommon5.so.5 from rpm plasma-breeze-5.27.11-1.fc39.x86_64 Module libKF5Kirigami2.so.5 from rpm kf5-kirigami2-5.115.0-1.fc39.x86_64 Module breeze.so from rpm plasma-breeze-5.27.11-1.fc39.x86_64 Module libpciaccess.so.0 from rpm libpciaccess-0.16-9.fc39.x86_64 Module libtinfo.so.6 from rpm ncurses-6.4-7.20230520.fc39.1.x86_64 Module libedit.so.0 from rpm libedit-3.1-48.20230828cvs.fc39.x86_64 Module libdrm_intel.so.1 from rpm libdrm-2.4.120-1.fc39.x86_64 Module libdrm_nouveau.so.2 from rpm libdrm-2.4.120-1.fc39.x86_64 Module libdrm_amdgpu.so.1 from rpm libdrm-2.4.120-1.fc39.x86_64 Module libelf.so.1 from rpm elfutils-0.191-2.fc39.x86_64 Module libdrm_radeon.so.1 from rpm libdrm-2.4.120-1.fc39.x86_64 Module libsensors.so.4 from rpm lm_sensors-3.6.0-14.fc39.x86_64 Module radeonsi_dri.so from rpm mesa-23.3.6-1.fc39.x86_64 Module libxshmfence.so.1 from rpm libxshmfence-1.3-13.fc39.x86_64 Module libxcb-sync.so.1 from rpm libxcb-1.13.1-12.fc39.x86_64 Module libxcb-present.so.0 from rpm libxcb-1.13.1-12.fc39.x86_64 Module libxcb-dri3.so.0 from rpm libxcb-1.13.1-12.fc39.x86_64 Module libwayland-server.so.0 from rpm wayland-1.22.0-2.fc39.x86_64 Module libdrm.so.2 from rpm libdrm-2.4.120-1.fc39.x86_64 Module libxcb-xfixes.so.0 from rpm libxcb-1.13.1-12.fc39.x86_64 Module libxcb-randr.so.0 from rpm libxcb-1.13.1-12.fc39.x86_64 Module libxcb-dri2.so.0 from rpm libxcb-1.13.1-12.fc39.x86_64 Module libX11-xcb.so.1 from rpm libX11-1.8.7-1.fc39.x86_64 Module libexpat.so.1 from rpm expat-2.6.0-1.fc39.x86_64 Module libglapi.so.0 from rpm mesa-23.3.6-1.fc39.x86_64 Module libgbm.so.1 from rpm mesa-23.3.6-1.fc39.x86_64 Module libEGL_mesa.so.0 from rpm mesa-23.3.6-1.fc39.x86_64 Module libwayland-egl.so.1 from rpm wayland-1.22.0-2.fc39.x86_64 Module libEGL.so.1 from rpm libglvnd-1.7.0-1.fc39.x86_64 Module libqt-plugin-wayland-egl.so from rpm qt5-qtwayland-5.15.12-2.fc39.x86_64 Module libogg.so.0 from rpm libogg-1.3.5-6.fc39.x86_64 Module libvorbis.so.0 from rpm libvorbis-1.3.7-8.fc39.x86_64 Module libXi.so.6 from rpm libXi-1.8.1-2.fc39.x86_64 Module libltdl.so.7 from rpm libtool-2.4.7-7.fc39.x86_64 Module libtdb.so.1 from rpm libtdb-1.4.9-1.fc39.x86_64 Module libvorbisfile.so.3 from rpm libvorbis-1.3.7-8.fc39.x86_64 Module libQt5QmlModels.so.5 from rpm qt5-qtdeclarative-5.15.12-1.fc39.x86_64 Module libQt5QuickTemplates2.so.5 from rpm qt5-qtquickcontrols2-5.15.12-1.fc39.x86_64 Module libXrender.so.1 from rpm libXrender-0.9.11-3.fc39.x86_64 Module libXfixes.so.3 from rpm libXfixes-6.0.0-6.fc39.x86_64 Module libdbusmenu-qt5.so.2 from rpm dbusmenu-qt-0.9.3-0.32.20160218.fc39.x86_64 Module libXtst.so.6 from rpm libXtst-1.2.4-3.fc39.x86_64 Module libKF5Bookmarks.so.5 from rpm kf5-kbookmarks-5.115.0-1.fc39.x86_64 Module libQt5Quick.so.5 from rpm qt5-qtdeclarative-5.15.12-1.fc39.x86_64 Module libQt5QuickControls2.so.5 from rpm qt5-qtquickcontrols2-5.15.12-1.fc39.x86_64 Module libXcursor.so.1 from rpm libXcursor-1.2.1-4.fc39.x86_64 Module libKF5Notifications.so.5 from rpm kf5-knotifications-5.115.0-1.fc39.x86_64 Module libKF5KIOFileWidgets.so.5 from rpm kf5-kio-5.115.0-1.fc39.x86_64 Module KDEPlasmaPlatformTheme.so from rpm plasma-integration-5.27.11-1.fc39.x86_64 Module libcomposeplatforminputcontextplugin.so from rpm qt5-qtbase-5.15.12-5.fc39.x86_64 Module libqwayland-generic.so from rpm qt5-qtwayland-5.15.12-2.fc39.x86_64 Module libcrypt.so.2 from rpm libxcrypt-4.4.36-2.fc39.x86_64 Module libsasl2.so.3 from rpm cyrus-sasl-2.1.28-11.fc39.x86_64 Module libevent-2.1.so.7 from rpm libevent-2.1.12-9.fc39.x86_64 Module libunistring.so.5 from rpm libunistring-1.1-5.fc39.x86_64 Module libxml2.so.2 from rpm libxml2-2.10.4-3.fc39.x86_64 Module libbrotlicommon.so.1 from rpm brotli-1.1.0-1.fc39.x86_64 Module libgmodule-2.0.so.0 from rpm glib2-2.78.3-1.fc39.x86_64 Module libpsl.so.5 from rpm libpsl-0.21.2-4.fc39.x86_64 Module libssh.so.4 from rpm libssh-0.10.6-2.fc39.x86_64 Module libidn2.so.0 from rpm libidn2-2.3.7-1.fc39.x86_64 Module libnghttp2.so.14 from rpm nghttp2-1.55.1-4.fc39.x86_64 Module libusbmuxd-2.0.so.6 from rpm libusbmuxd-2.0.2^20230620git8d30a55-3.fc39.x86_64 Module libimobiledevice-glue-1.0.so.0 from rpm libimobiledevice-glue-1.0.0-1.fc39.x86_64 Module libxkbcommon.so.0 from rpm libxkbcommon-1.6.0-1.fc39.x86_64 Module libfontconfig.so.1 from rpm fontconfig-2.14.2-6.fc39.x86_64 Module libwayland-cursor.so.0 from rpm wayland-1.22.0-2.fc39.x86_64 Module libbrotlidec.so.1 from rpm brotli-1.1.0-1.fc39.x86_64 Module libffi.so.8 from rpm libffi-3.4.4-4.fc39.x86_64 Module libduktape.so.207 from rpm duktape-2.7.0-5.fc39.x86_64 Module libgio-2.0.so.0 from rpm glib2-2.78.3-1.fc39.x86_64 Module libcurl.so.4 from rpm curl-8.2.1-4.fc39.x86_64 Module libselinux.so.1 from rpm libselinux-3.5-5.fc39.x86_64 Module libblkid.so.1 from rpm util-linux-2.39.3-6.fc39.x86_64 Module libattr.so.1 from rpm attr-2.5.1-8.fc39.x86_64 Module libplist-2.0.so.4 from rpm libplist-2.3.0-1.fc39.x86_64 Module libimobiledevice-1.0.so.6 from rpm libimobiledevice-1.3.0^20230705git6fc41f5-1.fc39.x86_64 Module libwayland-client.so.0 from rpm wayland-1.22.0-2.fc39.x86_64 Module libQt5WaylandClient.so.5 from rpm qt5-qtwayland-5.15.12-2.fc39.x86_64 Module libbz2.so.1 from rpm bzip2-1.0.8-16.fc39.x86_64 Module libpcre2-8.so.0 from rpm pcre2-10.42-1.fc39.2.x86_64 Module libicudata.so.73 from rpm icu-73.2-2.fc39.x86_64 Module liblzma.so.5 from rpm xz-5.4.4-1.fc39.x86_64 Module liblz4.so.1 from rpm lz4-1.9.4-4.fc39.x86_64 Module libgraphite2.so.3 from rpm graphite2-1.3.14-12.fc39.x86_64 Module libfreetype.so.6 from rpm freetype-2.13.1-2.fc39.x86_64 Module libGLdispatch.so.0 from rpm libglvnd-1.7.0-1.fc39.x86_64 Module libXext.so.6 from rpm libXext-1.3.5-3.fc39.x86_64 Module libGLX.so.0 from rpm libglvnd-1.7.0-1.fc39.x86_64 Module libgobject-2.0.so.0 from rpm glib2-2.78.3-1.fc39.x86_64 Module libpxbackend-1.0.so from rpm libproxy-0.5.3-3.fc39.x86_64 Module libkeyutils.so.1 from rpm keyutils-1.6.1-7.fc39.x86_64 Module libkrb5support.so.0 from rpm krb5-1.21.2-3.fc39.x86_64 Module libcom_err.so.2 from rpm e2fsprogs-1.47.0-2.fc39.x86_64 Module libk5crypto.so.3 from rpm krb5-1.21.2-3.fc39.x86_64 Module libkrb5.so.3 from rpm krb5-1.21.2-3.fc39.x86_64 Module libcap.so.2 from rpm libcap-2.48-9.fc39.x86_64 Module libXau.so.6 from rpm libXau-1.0.11-3.fc39.x86_64 Module libQt5Svg.so.5 from rpm qt5-qtsvg-5.15.12-1.fc39.x86_64 Module libKF5GlobalAccel.so.5 from rpm kf5-kglobalaccel-5.115.0-1.fc39.x86_64 Module libmount.so.1 from rpm util-linux-2.39.3-6.fc39.x86_64 Module libacl.so.1 from rpm acl-2.3.1-9.fc39.x86_64 Module libKF5Solid.so.5 from rpm kf5-solid-5.115.0-1.fc39.x86_64 Module libQt5TextToSpeech.so.5 from rpm qt5-qtspeech-5.15.12-1.fc39.x86_64 Module libKF5AuthCore.so.5 from rpm kf5-kauth-5.115.0-1.fc39.x86_64 Module libKF5Codecs.so.5 from rpm kf5-kcodecs-5.115.0-1.fc39.x86_64 Module libKF5GuiAddons.so.5 from rpm kf5-kguiaddons-5.115.0-1.fc39.x86_64 Module libKF5Completion.so.5 from rpm kf5-kcompletion-5.115.0-1.fc39.x86_64 Module libKF5SonnetCore.so.5 from rpm kf5-sonnet-5.115.0-1.fc39.x86_64 Module libKF5SonnetUi.so.5 from rpm kf5-sonnet-5.115.0-1.fc39.x86_64 Module libKF5ItemViews.so.5 from rpm kf5-kitemviews-5.115.0-1.fc39.x86_64 Module libQt5PrintSupport.so.5 from rpm qt5-qtbase-5.15.12-5.fc39.x86_64 Module libeditorconfig.so.0 from rpm editorconfig-0.12.6-2.fc39.x86_64 Module libKF5Archive.so.5 from rpm kf5-karchive-5.115.0-1.fc39.x86_64 Module libQt5Qml.so.5 from rpm qt5-qtdeclarative-5.15.12-1.fc39.x86_64 Module libglib-2.0.so.0 from rpm glib2-2.78.3-1.fc39.x86_64 Module libzstd.so.1 from rpm zstd-1.5.5-4.fc39.x86_64 Module libpcre2-16.so.0 from rpm pcre2-10.42-1.fc39.2.x86_64 Module libicuuc.so.73 from rpm icu-73.2-2.fc39.x86_64 Module libicui18n.so.73 from rpm icu-73.2-2.fc39.x86_64 Module libdouble-conversion.so.3 from rpm double-conversion-3.1.5-9.fc39.x86_64 Module libsystemd.so.0 from rpm systemd-254.10-1.fc39.x86_64 Module libdbus-1.so.3 from rpm dbus-1.14.10-1.fc39.x86_64 Module libharfbuzz.so.0 from rpm harfbuzz-8.2.1-2.fc39.x86_64 Module libpng16.so.16 from rpm libpng-1.6.37-15.fc39.x86_64 Module libGL.so.1 from rpm libglvnd-1.7.0-1.fc39.x86_64 Module libcrypto.so.3 from rpm openssl-3.1.1-4.fc39.x86_64 Module libssl.so.3 from rpm openssl-3.1.1-4.fc39.x86_64 Module libproxy.so.1 from rpm libproxy-0.5.3-3.fc39.x86_64 Module libgssapi_krb5.so.2 from rpm krb5-1.21.2-3.fc39.x86_64 Module libz.so.1 from rpm zlib-1.2.13-4.fc39.x86_64 Module libudev.so.1 from rpm systemd-254.10-1.fc39.x86_64 Module libxcb-keysyms.so.1 from rpm xcb-util-keysyms-0.4.1-3.fc39.x86_64 Module libxcb.so.1 from rpm libxcb-1.13.1-12.fc39.x86_64 Module libX11.so.6 from rpm libX11-1.8.7-1.fc39.x86_64 Module libKUserFeedbackCore.so.1 from rpm kuserfeedback-1.3.0-1.fc39.x86_64 Module libKF5SyntaxHighlighting.so.5 from rpm kf5-syntax-highlighting-5.115.0-1.fc39.x86_64 Module libQt5Xml.so.5 from rpm qt5-qtbase-5.15.12-5.fc39.x86_64 Module libKF5ConfigCore.so.5 from rpm kf5-kconfig-5.115.0-1.fc39.x86_64 Module libKF5ConfigGui.so.5 from rpm kf5-kconfig-5.115.0-1.fc39.x86_64 Module libKF5WidgetsAddons.so.5 from rpm kf5-kwidgetsaddons-5.115.0-1.fc39.x86_64 Module libKF5ConfigWidgets.so.5 from rpm kf5-kconfigwidgets-5.115.0-1.fc39.x86_64 Module libKF5IconThemes.so.5 from rpm kf5-kiconthemes-5.115.0-1.fc39.x86_64 Module libKF5XmlGui.so.5 from rpm kf5-kxmlgui-5.115.0-1.fc39.x86_64 Module libKF5JobWidgets.so.5 from rpm kf5-kjobwidgets-5.115.0-1.fc39.x86_64 Module libKF5Service.so.5 from rpm kf5-kservice-5.115.0-1.fc39.x86_64 Module libKF5Crash.so.5 from rpm kf5-kcrash-5.115.0-1.fc39.x86_64 Module libKF5KIOCore.so.5 from rpm kf5-kio-5.115.0-1.fc39.x86_64 Module libKF5KIOGui.so.5 from rpm kf5-kio-5.115.0-1.fc39.x86_64 Module libKF5KIOWidgets.so.5 from rpm kf5-kio-5.115.0-1.fc39.x86_64 Module libKF5TextWidgets.so.5 from rpm kf5-ktextwidgets-5.115.0-1.fc39.x86_64 Module libKF5Parts.so.5 from rpm kf5-kparts-5.115.0-1.fc39.x86_64 Module libKUserFeedbackWidgets.so.1 from rpm kuserfeedback-1.3.0-1.fc39.x86_64 Module libKF5Activities.so.5 from rpm kf5-kactivities-5.115.0-1.fc39.x86_64 Module libKF5TextEditor.so.5 from rpm kf5-ktexteditor-5.115.0-1.fc39.x86_64 Module libQt5Core.so.5 from rpm qt5-qtbase-5.15.12-5.fc39.x86_64 Module libQt5DBus.so.5 from rpm qt5-qtbase-5.15.12-5.fc39.x86_64 Module libQt5Gui.so.5 from rpm qt5-qtbase-5.15.12-5.fc39.x86_64 Module libQt5Network.so.5 from rpm qt5-qtbase-5.15.12-5.fc39.x86_64 Module libQt5Widgets.so.5 from rpm qt5-qtbase-5.15.12-5.fc39.x86_64 Module libKF5CoreAddons.so.5 from rpm kf5-kcoreaddons-5.115.0-1.fc39.x86_64 Module libKF5I18n.so.5 from rpm kf5-ki18n-5.115.1-1.fc39.x86_64 Module libKF5WindowSystem.so.5 from rpm kf5-kwindowsystem-5.115.0-1.fc39.x86_64 Module libQt5X11Extras.so.5 from rpm qt5-qtx11extras-5.15.12-1.fc39.x86_64 Module libKF5DBusAddons.so.5 from rpm kf5-kdbusaddons-5.115.0-1.fc39.x86_64 Module libkateprivate.so.23.08.5 from rpm kate-23.08.5-1.fc39.x86_64 Module kate from rpm kate-23.08.5-1.fc39.x86_64 Stack trace of thread 1224984: #0 0x00007fd157a8fbf4 __poll (libc.so.6 + 0x107bf4) #1 0x00007fd1523270bc _ZN15QtWaylandClient11EventThread3runEv (libQt5WaylandClient.so.5 + 0x800bc) #2 0x00007fd1574f5cad _ZN14QThreadPrivate5startEPv (libQt5Core.so.5 + 0xf5cad) #3 0x00007fd157a16897 start_thread (libc.so.6 + 0x8e897) #4 0x00007fd157a9d80c __clone3 (libc.so.6 + 0x11580c) Stack trace of thread 1224985: #0 0x00007fd157a8fbf4 __poll (libc.so.6 + 0x107bf4) #1 0x00007fd1523270bc _ZN15QtWaylandClient11EventThread3runEv (libQt5WaylandClient.so.5 + 0x800bc) #2 0x00007fd1574f5cad _ZN14QThreadPrivate5startEPv (libQt5Core.so.5 + 0xf5cad) #3 0x00007fd157a16897 start_thread (libc.so.6 + 0x8e897) #4 0x00007fd157a9d80c __clone3 (libc.so.6 + 0x11580c) Stack trace of thread 1224983: #0 0x00007fd157a8fbed __poll (libc.so.6 + 0x107bed) #1 0x00007fd154f6ceb4 g_main_context_iterate_unlocked.isra.0 (libglib-2.0.so.0 + 0xb6eb4) #2 0x00007fd154f0fad3 g_main_context_iteration (libglib-2.0.so.0 + 0x59ad3) #3 0x00007fd1577073b9 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x3073b9) #4 0x00007fd1576b383b _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2b383b) #5 0x00007fd1574f48a0 _ZN7QThread4execEv (libQt5Core.so.5 + 0xf48a0) #6 0x00007fd157b85dab _ZN22QDBusConnectionManager3runEv (libQt5DBus.so.5 + 0x1bdab) #7 0x00007fd1574f5cad _ZN14QThreadPrivate5startEPv (libQt5Core.so.5 + 0xf5cad) #8 0x00007fd157a16897 start_thread (libc.so.6 + 0x8e897) #9 0x00007fd157a9d80c __clone3 (libc.so.6 + 0x11580c) Stack trace of thread 1224987: #0 0x00007fd157a13169 __futex_abstimed_wait_common (libc.so.6 + 0x8b169) #1 0x00007fd157a15b09 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8db09) #2 0x00007fd139b6e58d cnd_wait (radeonsi_dri.so + 0x16e58d) #3 0x00007fd139b4d3fb util_queue_thread_func (radeonsi_dri.so + 0x14d3fb) #4 0x00007fd139b6e4bc impl_thrd_routine (radeonsi_dri.so + 0x16e4bc) #5 0x00007fd157a16897 start_thread (libc.so.6 + 0x8e897) #6 0x00007fd157a9d80c __clone3 (libc.so.6 + 0x11580c) Stack trace of thread 1224982: #0 0x00007fd157a8fbed __poll (libc.so.6 + 0x107bed) #1 0x00007fd154f6ceb4 g_main_context_iterate_unlocked.isra.0 (libglib-2.0.so.0 + 0xb6eb4) #2 0x00007fd154f0fad3 g_main_context_iteration (libglib-2.0.so.0 + 0x59ad3) #3 0x00007fd1577073b9 _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x3073b9) #4 0x00007fd1576b383b _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2b383b) #5 0x00007fd1576bbacb _ZN16QCoreApplication4execEv (libQt5Core.so.5 + 0x2bbacb) #6 0x0000560b0020b3e7 main (kate + 0xa3e7) #7 0x00007fd1579b014a __libc_start_call_main (libc.so.6 + 0x2814a) #8 0x00007fd1579b020b __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x2820b) #9 0x0000560b0020d7d5 _start (kate + 0xc7d5) Stack trace of thread 1224990: #0 0x00007fd157a13169 __futex_abstimed_wait_common (libc.so.6 + 0x8b169) #1 0x00007fd157a15b09 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8db09) #2 0x00007fd139b6e58d cnd_wait (radeonsi_dri.so + 0x16e58d) #3 0x00007fd139b4d3fb util_queue_thread_func (radeonsi_dri.so + 0x14d3fb) #4 0x00007fd139b6e4bc impl_thrd_routine (radeonsi_dri.so + 0x16e4bc) #5 0x00007fd157a16897 start_thread (libc.so.6 + 0x8e897) #6 0x00007fd157a9d80c __clone3 (libc.so.6 + 0x11580c) Stack trace of thread 1224986: #0 0x00007fd157a13169 __futex_abstimed_wait_common (libc.so.6 + 0x8b169) #1 0x00007fd157a15b09 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8db09) #2 0x00007fd139b6e58d cnd_wait (radeonsi_dri.so + 0x16e58d) #3 0x00007fd139b4d3fb util_queue_thread_func (radeonsi_dri.so + 0x14d3fb) #4 0x00007fd139b6e4bc impl_thrd_routine (radeonsi_dri.so + 0x16e4bc) #5 0x00007fd157a16897 start_thread (libc.so.6 + 0x8e897) #6 0x00007fd157a9d80c __clone3 (libc.so.6 + 0x11580c) Stack trace of thread 1224989: #0 0x00007fd157a13169 __futex_abstimed_wait_common (libc.so.6 + 0x8b169) #1 0x00007fd157a15b09 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8db09) #2 0x00007fd139b6e58d cnd_wait (radeonsi_dri.so + 0x16e58d) #3 0x00007fd139b4d3fb util_queue_thread_func (radeonsi_dri.so + 0x14d3fb) #4 0x00007fd139b6e4bc impl_thrd_routine (radeonsi_dri.so + 0x16e4bc) #5 0x00007fd157a16897 start_thread (libc.so.6 + 0x8e897) #6 0x00007fd157a9d80c __clone3 (libc.so.6 + 0x11580c) Stack trace of thread 1224991: #0 0x00007fd157a13169 __futex_abstimed_wait_common (libc.so.6 + 0x8b169) #1 0x00007fd157a15b09 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8db09) #2 0x00007fd139b6e58d cnd_wait (radeonsi_dri.so + 0x16e58d) #3 0x00007fd139b4d3fb util_queue_thread_func (radeonsi_dri.so + 0x14d3fb) #4 0x00007fd139b6e4bc impl_thrd_routine (radeonsi_dri.so + 0x16e4bc) #5 0x00007fd157a16897 start_thread (libc.so.6 + 0x8e897) #6 0x00007fd157a9d80c __clone3 (libc.so.6 + 0x11580c) Stack trace of thread 1224988: #0 0x00007fd157a13169 __futex_abstimed_wait_common (libc.so.6 + 0x8b169) #1 0x00007fd157a15b09 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x8db09) #2 0x00007fd139b6e58d cnd_wait (radeonsi_dri.so + 0x16e58d) #3 0x00007fd139b4d3fb util_queue_thread_func (radeonsi_dri.so + 0x14d3fb) #4 0x00007fd139b6e4bc impl_thrd_routine (radeonsi_dri.so + 0x16e4bc) #5 0x00007fd157a16897 start_thread (libc.so.6 + 0x8e897) #6 0x00007fd157a9d80c __clone3 (libc.so.6 + 0x11580c) ELF object binary architecture: AMD x86-64 Mar 26 15:41:23 systemd[1]: systemd-coredump@21-1225059-0.service: Deactivated successfully. Mar 26 15:41:23 audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@21-1225059-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' Mar 26 15:41:23 audit: BPF prog-id=495 op=UNLOAD Mar 26 15:41:23 audit: BPF prog-id=494 op=UNLOAD Mar 26 15:41:23 audit: BPF prog-id=493 op=UNLOAD Mar 26 15:41:24 abrt-server[1225093]: The crashed process was ptraced - not saving the crash Mar 26 15:41:24 abrt-server[1225093]: 'post-create' on '/var/spool/abrt/ccpp-2024-03-26-17:41:24.43-1224982' exited with 1 Mar 26 15:41:24 abrt-server[1225093]: Deleting problem directory '/var/spool/abrt/ccpp-2024-03-26-17:41:24.43-1224982' ```
eteran commented 3 months ago

OK, seems like we're learning something, but it is definitely a curious mystery. The main thing I'm not understanding at the moment is that your core dump says: "The crashed process was ptraced - not saving the crash"

So that makes it sound like the OS still thinks that a debugger was attached. Very strange. I'll have to think on it. But also may just install Fedora 39 in a VM to see if I can replicate it.

Anything non-stock about your configuration?

brndd commented 3 months ago

Anything non-stock about your configuration?

Nothing in particular besides this being a somewhat old installation (dating back to Fedora 33 or something). Oh, and last I used edb a year or so back, it worked fine. But that was version 1.2.0, and I couldn't get it to compile with modern Fedora packages. I use the KDE spin, though I really wouldn't expect that to matter.

I will also try replicating this in a VM. Will report back.

brndd commented 3 months ago

OK, could not reproduce this in a VM. I did notice that Kate was a bit crash-happy in the VM too, presumably because of the many threads it uses, so I used nano (running in a separate terminal) for debugging instead.

On my host machine, nano makes for a consistent repro:

  1. Launch a terminal (Konsole in this case), run nano in it
  2. Launch edb
  3. File > attach, find the nano process
  4. The program state will almost certainly be "Interrupted SYSCALL: read", because nano seems to wait on that syscall a lot for keyboard input
  5. Press "Step over"
  6. Try to type something into nano
  7. nano will crash with the reason "trace trap" printed in the terminal

It doesn't crash in the VM using the same build of edb (from this COPR). It also doesn't crash on my laptop which similarly runs Fedora 39 (though is slightly out of date; I'll edit this space after seeing if it still works once I've updated the laptop still works after updating).

To my understanding this would mean that edb managed to set a breakpoint but did not manage to catch it, so the program dies due to the uncaught signal. But curiously in this case the system journal still displays the line about the process being ptraced. And it's also weird that gdb works perfectly fine on my PC, even doing the same actions on the same executable.

brndd commented 3 months ago

Running cat /proc/$(pgrep nano)/status after step 3 above shows that edb's pid is attached to the process (TracerPid), and the process State is t (tracer stop). So edb is getting attached, but for some reason the tracer stop signal goes to the debuggee process...?

eteran commented 3 months ago

Very interesting, thanks for doing the experiments. I can say that one thing that I find puzzling is why it's only happening on a particular machine. I am worried that I won't be able to reproduce it properly.

One thing that's worth checking as well. Is it possible that there is some kind of plugin mismatch?

As in, a system installation, or even a previous one in a different location, but the settings are still pointing to the old plugins? I can imagine that would cause havok.

Can you try doing something like this:

Make sure edb is closed, then

mv ~/.config/codef00.com/edb.conf ~/.config/codef00.com/edb.conf.bak

if you aren't doing a system-wide install, make sure there are no lingering plugins in /usr/local/lib/edb then re-run it so it generates a fresh configuration.

brndd commented 3 months ago

I had a look at the config file (didn't think about doing so before), and figured it out. And the cause was really stupid.

Under Preferences > Signals/Exceptions, I had ticked every signal, including SIGTRAP, to be ignored (passed to debuggee). Or presumably it was me; I only vaguely remember possibly having done this, but I don't think these would tick themselves so who else can I blame...

So edb was doing exactly what it was configured to do and passing SIGTRAP to the debugged program, which, being unhandled, would crash it. I unchecked all the boxes there and now debugging works again. :man_facepalming:

Thanks for the help with the troubleshooting and sorry about the noise.

eteran commented 3 months ago

LOL, no worries at all, now if someone else has a similar issue, hopefully they can find this issue.

Maybe we should add a warning about SIGTRAP if it's checked ;-)