From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6A3353858283; Sun, 28 Jan 2024 00:51:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A3353858283 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706403078; bh=n/xIKvriu76wngMjJ3aqllL/NHLN9OC7CeUjH878j+0=; h=From:To:Subject:Date:From; b=ZHHezZCiTTjlGDuzizfRnj6DSq7bmeuoTo8Socf7QxrADBi9bwkYbwsOJQhCfa2sD gTi+9sW9aB7vyoLKs3IjW2ZITJvMPocRp2kXhpSkYPAFPKpnSy1dIJ+FaHkWPg0kkW NcFRbyGsoTKJvz9pN1C5ahXKUp9nwdjL2kFRLzv0= From: "grazfather at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug remote/31303] New: attach calls python hooks which can crash gdb Date: Sun, 28 Jan 2024 00:51:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: remote X-Bugzilla-Version: 13.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: grazfather 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=3D31303 Bug ID: 31303 Summary: attach calls python hooks which can crash gdb Product: gdb Version: 13.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: remote Assignee: unassigned at sourceware dot org Reporter: grazfather at gmail dot com Target Milestone: --- Created attachment 15337 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D15337&action=3Ded= it stacktrace On GDB 13.2, when debugging a target using `target extended-remote` with a continue hook setup which tries to get the selected frame, when I `attach 1= `, this hook is called and gdb crashes with a failed assertion. ../../gdb/thread.c:85: internal-error: inferior_thread: Assertion `current_thread_ !=3D nullptr' failed. A problem internal to GDB has been detected, This hook does not seem to be called when I attach to a local process (by p= id). Stack trace is attached. I reproduce with a blackmagic probe connected to a tty. .gdbinit: source hook_continue.py target extended-remote /dev/cu.usbmodel72AE15F41 monitor tpwr enable monitor swdp_scan attach 1 hook_continue.py: def f(_): gdb.selected_frame() =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20 gdb.events.cont.connect= (f) --=20 You are receiving this mail because: You are on the CC list for the bug.=