From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0F2BA3858D38; Tue, 27 Dec 2022 15:40:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F2BA3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672155603; bh=ifgSXQelDXt249WyjhkzrJzTlUCUZ2Ph3Md6QaesSXU=; h=From:To:Subject:Date:From; b=k6iiSjr6/XhwxEzWBK/deGYDOV15aEGmKolqnCQizr/FGKj+uFun3tSetQTYjJRtW nqhc13UotWkBGn3ULav4ajOVm6xbcEYYzGNc6m9T8l01v8Ujhw+9EGzIwRb0wkjUzJ VIgG1fhFevXQ8Wd8NQCTzaZzx8VhB8zWLzBw9dPQ= From: "exclusion at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug threads/29944] New: Assertion 'filter_target != nullptr' failed when switching inferior inside the exited event handler Date: Tue, 27 Dec 2022 15:40:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: threads X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: exclusion at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29944 Bug ID: 29944 Summary: Assertion 'filter_target !=3D 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=3D14539&action=3Ded= it 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=3D/tmp/tmpdb rm -rf "$PGDB" || true; /usr/lib/postgresql/13/bin/initdb -D "$PGDB"=20 gdb --command=3D~/postgres-gdb.py --args /usr/lib/postgresql/13/bin/postgre= s -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 !=3D 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 HE= AD (b19d96d1). --=20 You are receiving this mail because: You are on the CC list for the bug.=