public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "pedro at palves dot net" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug tdep/30252] gdb-13.1/gdb/target.c:2641: internal-error: target_resume: Assertion `inferior_ptid != null_ptid' failed Date: Thu, 23 Mar 2023 16:13:28 +0000 [thread overview] Message-ID: <bug-30252-4717-2pNDNPshk8@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-30252-4717@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=30252 --- Comment #5 from Pedro Alves <pedro at palves dot net> --- The problem is that the backend called target_resume without switching to the leader thread of that resumption. - inferior_ptid is a global in gdb that points at the currently selected thread. - inferior_ptid == null_ptid means no thread is selected at that point. - The target_resume interface is: /* Resume execution (or prepare for execution) of the current thread (INFERIOR_PTID), while optionally letting other threads of the current process or all processes run free. ... Thus calling target_resume with inferior_ptid == null_ptid is bogus. target_wait (which leads to procfs_target::wait on Solaris) is called with inferior_ptid == null_ptid on entry exactly to help catch such bogus uses. It's procfs_target::wait that is calling target_resume incorrectly. From the backtrace, it seems that the line in question is 2187, which has: /* How to keep going without returning to wfi: */ target_continue_no_signal (ptid); goto wait_again; target_continue_no_signal is a small wrapper around target_resume, which would make sense. I guess we don't see target_continue_no_signal in the backtrace because that is an optimized gdb build. I'm writing a fix. -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2023-03-23 16:13 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-03-20 16:00 [Bug gdb/30252] New: " petr.sumbera at oracle dot com 2023-03-20 16:01 ` [Bug gdb/30252] " petr.sumbera at oracle dot com 2023-03-21 9:08 ` petr.sumbera at oracle dot com 2023-03-21 14:55 ` [Bug tdep/30252] " tromey at sourceware dot org 2023-03-22 1:02 ` simark at simark dot ca 2023-03-22 8:06 ` petr.sumbera at oracle dot com 2023-03-23 16:13 ` pedro at palves dot net [this message] 2023-03-23 17:36 ` pedro at palves dot net 2023-03-24 8:06 ` petr.sumbera at oracle dot com 2023-06-12 20:16 ` marcel at telka dot sk 2023-07-06 14:10 ` cvs-commit at gcc dot gnu.org 2023-07-06 14:12 ` cvs-commit at gcc dot gnu.org 2023-07-06 14:15 ` pedro at palves dot net
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-30252-4717-2pNDNPshk8@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).