public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "andrew.burgess at embecosm dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/27830] Attempt to resume already running thread
Date: Mon, 10 May 2021 19:24:27 +0000	[thread overview]
Message-ID: <bug-27830-4717-zH1Z6LNGtM@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27830-4717@http.sourceware.org/bugzilla/>

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

--- Comment #3 from Andrew Burgess <andrew.burgess at embecosm dot com> ---
Created attachment 13432
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13432&action=edit
testsuite patch

Of course, once I realised that what we have is a thread that manages to be
running when it shouldn't be, then it's easy enough to get GDB to trigger an
assertion like this:

  internal-error: int finish_step_over(execution_control_state*): Assertion
`ecs->event_thread->control.trap_expected' failed.

What's happening here is the new thread, the thread that GDB isn't expecting to
be running, is hitting a stop event.  The thread then ends up inside
finish_step_over, where we make some assertions about the state of the thread
that we expect to stop.  As the thread that actually stops is not the one we
expect, things go wrong and we hit the assertion.

The attached patch adds a new testcase that exposes this issue (on
x86-64/Linux).

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

  parent reply	other threads:[~2021-05-10 19:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 14:16 [Bug gdb/27830] New: " andrew.burgess at embecosm dot com
2021-05-07 14:26 ` [Bug gdb/27830] " andrew.burgess at embecosm dot com
2021-05-10 17:27 ` andrew.burgess at embecosm dot com
2021-05-10 19:24 ` andrew.burgess at embecosm dot com [this message]
2022-06-21 11:28 ` pedro at palves dot net
2023-11-13 14:25 ` cvs-commit at gcc dot gnu.org
2023-11-13 14:25 ` cvs-commit at gcc dot gnu.org
2023-11-13 14:25 ` cvs-commit at gcc dot gnu.org
2023-11-13 14:25 ` cvs-commit at gcc dot gnu.org
2023-11-13 14:25 ` cvs-commit at gcc dot gnu.org
2023-11-13 15:00 ` 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-27830-4717-zH1Z6LNGtM@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: link
Be 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).