public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug threads/29944] New: Assertion 'filter_target != nullptr' failed when switching inferior inside the exited event handler
@ 2022-12-27 15:40 exclusion at gmail dot com
  0 siblings, 0 replies; only message in thread
From: exclusion at gmail dot com @ 2022-12-27 15:40 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29944

            Bug ID: 29944
           Summary: Assertion 'filter_target != nullptr' failed when
                    switching inferior inside the exited event handler
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: threads
          Assignee: unassigned at sourceware dot org
          Reporter: exclusion at gmail dot com
  Target Milestone: ---

Created attachment 14539
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14539&action=edit
The crash backtrace

When trying to run PostgreSQL (e.g., postgresql-13 on Debian 11, installed with
"sudo apt install postgresql-13") under GDB using the following script:
###
PGDB=/tmp/tmpdb
rm -rf "$PGDB" || true; /usr/lib/postgresql/13/bin/initdb -D "$PGDB" 
gdb --command=~/postgres-gdb.py --args /usr/lib/postgresql/13/bin/postgres -D
"$PGDB" -k /tmp/ -p 15432
###

and ~/postgres-gdb.py:
###
# Disable pagination to prevent interactive prompts
gdb.execute("set pagination off")
# Attach to both parent and child on fork
gdb.execute("set detach-on-fork off")
# Stop/resume all processes
gdb.execute("set schedule-multiple on")
# Don't stop child processes
gdb.execute("set non-stop on")

# Don't care about these signals
gdb.execute("handle SIGUSR1 noprint nostop pass")
gdb.execute("handle SIGUSR2 noprint nostop pass")
gdb.execute("handle SIGHUP print nostop pass")
gdb.execute("handle SIGTERM print nostop pass")
gdb.execute("handle SIGPIPE print nostop pass")
gdb.execute("handle SIGQUIT print nostop pass")


def exit_handler (event):
    gdb.execute("inferior 1")

gdb.events.exited.connect(exit_handler)

gdb.execute("run")
###

I get gdb crash with the following diagnostics:
2022-12-27 13:52:27.081 UTC [234091] LOG:  listening on Unix socket
"/tmp/.s.PGSQL.15432"
[New inferior 2 (process 234094)]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
2022-12-27 13:52:27.091 UTC [234094] LOG:  database system was shut down at
2022-12-27 13:52:26 UTC
[Inferior 2 (process 234094) exited normally]
[Switching to inferior 1 [process 234091]
(/usr/lib/postgresql/13/bin/postgres)]
[Switching to thread 1.1 (Thread 0x7ffff4994a40 (LWP 234091))](running)
thread-iter.c:109: internal-error: all_matching_threads_iterator: Assertion
`filter_target != nullptr' failed.
A problem internal to GDB has been detected,
...
Full backtrace is attached.

Initially observed with gdb 12.1 but then reproduced with gdb built from HEAD
(b19d96d1).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-27 15:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-27 15:40 [Bug threads/29944] New: Assertion 'filter_target != nullptr' failed when switching inferior inside the exited event handler exclusion at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).