From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 919063858419; Thu, 28 Oct 2021 14:31:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 919063858419 From: "simon.marchi at polymtl dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/28512] waitstatus.h:300: internal-error: gdb_signal target_waitstatus::sig() const: Assertion `m_kind == TARGET_WAITKIND_STOPPED || m_kind == TARGET_WAITKIND_SIGNALLED' failed. Date: Thu, 28 Oct 2021 14:31:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon.marchi at polymtl dot ca X-Bugzilla-Status: NEW 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: cc Message-ID: In-Reply-To: References: 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2021 14:31:51 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28512 Simon Marchi changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |simon.marchi at polymtl do= t ca --- Comment #8 from Simon Marchi --- Ah, thanks for the backtrace (and those who added that automatic backtracing feature!). I recognize it, I also hit it while working on an work-in-progr= ess patch, I made the obvious fix of adding `&& tp->pending_waitstatus ().kind = () =3D=3D TARGET_WAITKIND_STOPPED` to the condition, before accessing `->sig (= )`: diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index cada889c5348..dead4309704e 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -1267,7 +1267,8 @@ get_detach_signal (struct lwp_info *lp) if (target_is_non_stop_p () && !tp->executing ()) { - if (tp->has_pending_waitstatus ()) + if (tp->has_pending_waitstatus () + && tp->pending_waitstatus ().kind () =3D=3D TARGET_WAITKIND_S= TOPPED) signo =3D tp->pending_waitstatus ().sig (); else signo =3D tp->stop_signal (); I was wondering if it should check for TARGET_WAITKIND_SIGNALLED as well, b= ut I don't think so. If the target reported TARGET_WAITKIND_SIGNALLED for a process, it means it no longer exists (it's as if it had reported TARGET_WAITKIND_EXITED). It's not possible do detach a thread that no long= er exists. --=20 You are receiving this mail because: You are on the CC list for the bug.=