[Bug 280934] devel/gdb: "follow-exec-mode new" is broken

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 19 Aug 2024 20:20:10 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280934

            Bug ID: 280934
           Summary: devel/gdb: "follow-exec-mode new" is broken
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: pizzamig@freebsd.org
          Reporter: markj@FreeBSD.org
             Flags: maintainer-feedback?(pizzamig@freebsd.org)
          Assignee: pizzamig@freebsd.org

A simple reproducer for a gdb-14.1_2 crash that I'm hitting while trying to
debug something else:

$ gdb -q /bin/sh
Reading symbols from /bin/sh...
Reading symbols from /usr/lib/debug//bin/sh.debug...
(gdb) set follow-fork-mode child
(gdb) set follow-exec-mode new
(gdb) run
Starting program: /bin/sh 
$ ls
[Attaching after LWP 102411 of process 81670 fork to child LWP 127862 of
process 81671]
[New inferior 2 (process 81671)]
[Detaching after fork from parent process 81670]
[Inferior 1 (process 81670) detached]
process 81671 is executing new program: /bin/ls
[New inferior 3]
[New LWP 127862 of process 81671]


Fatal signal: Segmentation fault
----- Backtrace -----
0x1354cc1 ???
0x1477fc6 ???
0x147874f ???
0x802aad4eb handle_signal
        /root/freebsd/lib/libthr/thread/thr_sig.c:299
0x802aacaaa thr_sighandler
        /root/freebsd/lib/libthr/thread/thr_sig.c:243
0x7ffffffff2d2 ???
0x1492fc5 ???
0x14934cd ???
0x17adb29 ???
0x152405a ???
0x1522cfd ???
0x152222d ???
0x151bba5 ???
0x151a83b ???
0x1cbbed2 ???
0x1cbb776 ???
0x157e519 ???
0x157b600 ???
0x12531c0 ???
0x802b495d9 __libc_start1
        /root/freebsd/lib/libc/csu/libc_start1.c:157
0x12530af ???
---------------------
A fatal error internal to GDB has been detected, further
debugging is not possible.  GDB will now terminate.

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

-- 
You are receiving this mail because:
You are the assignee for the bug.