Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.
Czy ktoś z was bawił się w debugowanie procesów przy pomocy gdb? Niby jest na wiki debiana taki wpis ale chyba jest on ździebko nieaktualny albo ja coś robię nie tak. xD
Generalnie mamy przykładowe wywołanie:
$ gdb spacefm GNU gdb (Debian 15.2-1+b1) 15.2 ... Reading symbols from spacefm... Reading symbols from /usr/lib/debug/.build-id/53/b6168208901b7b230a4fe54a8add0b63c4e475.debug...
Symbole niby są. Doinstalowałem wszystkie pakiety o które prosił find-dbgsym-packages no ale jak się uruchomi przykładowy proces i doprowadzi go do segfault'a, to symboli brak...
(gdb) r Starting program: /usr/bin/spacefm This GDB supports auto-downloading debuginfo from the following URLs: <https://debuginfod.debian.net> Enable debuginfod for this session? (y or [n]) y Debuginfod has been enabled. ... Thread 1 "spacefm" received signal SIGSEGV, Segmentation fault. 0x00007ffff7eed551 in ?? () (gdb) bt full #0 0x00007ffff7eed551 in ?? () No symbol table info available. #1 0x00007ffff79785f0 in ?? () No symbol table info available. #2 0x5b1b4c4100000385 in ?? () No symbol table info available. #3 0x00000028000000aa in ?? () No symbol table info available. #4 0x343a303200000000 in ?? () No symbol table info available. #5 0x00000028000000aa in ?? () No symbol table info available. #6 0x6467203a00000641 in ?? () No symbol table info available. #7 0x0000064100000385 in ?? () No symbol table info available. #8 0x0000000000000000 in ?? () No symbol table info available.
Jeśli jednak się korzysta z coredumpctl od systemd, to wszystko ładnie drukuje:
$ coredumpctl gdb -1 PID: 221557 (spacefm) UID: 1000 (morfik) GID: 1000 (morfik) Signal: 11 (SEGV) Timestamp: Wed 2025-01-15 20:50:26 CET (24s ago) Command Line: spacefm Executable: /usr/bin/spacefm Control Group: /morfikownia.slice/libcgroup.scope/apps-user/file-manager Unit: libcgroup.scope Slice: morfikownia.slice Boot ID: 9b3e8d11480f41b0bff7c41b8220cf9a Machine ID: c59721c157404b63a846368d354b7ccf Hostname: morfikownia Storage: /var/lib/systemd/coredump/core.spacefm.1000.9b3e8d11480f41b0bff7c41b8220cf9a.221557.1736970626000000.zst (present) Size on Disk: 11.6M Message: Process 221557 (spacefm) of user 1000 dumped core. Module libgfortran.so.5 from deb gcc-14-14.2.0-13.amd64 Module libzstd.so.1 from deb libzstd-1.5.6+dfsg-2.amd64 Module libgomp.so.1 from deb gcc-14-14.2.0-13.amd64 Module libsystemd.so.0 from deb systemd-257.2-1.amd64 Module libblkid.so.1 from deb util-linux-2.40.4-1.amd64 Module libgcc_s.so.1 from deb gcc-14-14.2.0-13.amd64 Module libstdc++.so.6 from deb gcc-14-14.2.0-13.amd64 Module libatomic.so.1 from deb gcc-14-14.2.0-13.amd64 Module libmount.so.1 from deb util-linux-2.40.4-1.amd64 Module libudev.so.1 from deb systemd-257.2-1.amd64 Stack trace of thread 221557: #0 0x000074790409ad28 g_type_check_instance_is_a (libgobject-2.0.so.0 + 0x3bd28) #1 0x0000747904d4f5a9 gdk_event_source_get_filter_window (libgdk-3.so.0 + 0x945a9) #2 0x0000747904cf4554 gdk_display_get_event (libgdk-3.so.0 + 0x39554) #3 0x0000747904d4f356 gdk_event_source_dispatch (libgdk-3.so.0 + 0x94356) #4 0x0000747903f6a81f g_main_dispatch (libglib-2.0.so.0 + 0x5a81f) #5 0x0000747903f6ca57 g_main_context_dispatch_unlocked (libglib-2.0.so.0 + 0x5ca57) #6 0x0000747903f6d4af g_main_loop_run (libglib-2.0.so.0 + 0x5d4af) #7 0x0000747904606c8d gtk_main (libgtk-3.so.0 + 0x206c8d) #8 0x00005cddd0da7c5f n/a (n/a + 0x0) #9 0x6f732d6d66656361 n/a (n/a + 0x0) ELF object binary architecture: AMD x86-64 GNU gdb (Debian 15.2-1+b1) 15.2 ... Reading symbols from /usr/bin/spacefm... Reading symbols from /usr/lib/debug/.build-id/53/b6168208901b7b230a4fe54a8add0b63c4e475.debug... ... This GDB supports auto-downloading debuginfo from the following URLs: <https://debuginfod.debian.net> Enable debuginfod for this session? (y or [n]) Debuginfod has been disabled. To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `spacefm'. Program terminated with signal SIGSEGV, Segmentation fault. #0 g_type_check_instance_is_a (type_instance=type_instance@entry=0x5cdde07ab9c0, iface_type=102108015467024) at ../../../gobject/gtype.c:4141 warning: 4141 ../../../gobject/gtype.c: No such file or directory [Current thread is 1 (Thread 0x7478f7a0e240 (LWP 221557))] (gdb) bt full #0 g_type_check_instance_is_a (type_instance=type_instance@entry=0x5cdde07ab9c0, iface_type=102108015467024) at ../../../gobject/gtype.c:4141 node = 0x44444444ff1ffffc iface = 0x5cdddffd9a10 check = <optimized out> #1 0x0000747904d4f5a9 in gdk_event_source_get_filter_window (event_source=0x5cdddffeec80, xevent=0x7ffe9cf320e0, event_translator=<synthetic pointer>) at ../../../gdk/x11/gdkeventsource.c:123 __inst = 0x5cdde07ab9c0 __t = <optimized out> __r = <optimized out> list = 0x0 window = 0x5cdde07ab9c0 list = <optimized out> window = <optimized out> translator = <optimized out> __inst = <optimized out> ... ... ... (gdb) q
Także co tam trzeba w tym gdb określić jeszcze by działał bez potrzeby zaciągania do tego systemd? xD
Offline