public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/27338] New: Stepping over a breakpoint on an instruction that makes the thread exit is not correctly handled
@ 2021-02-03 20:00 simark at simark dot ca
  2021-02-03 20:00 ` [Bug gdb/27338] " simark at simark dot ca
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: simark at simark dot ca @ 2021-02-03 20:00 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 27338
           Summary: Stepping over a breakpoint on an instruction that
                    makes the thread exit is not correctly handled
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: simark at simark dot ca
  Target Milestone: ---

By default, targets don't report thread exit events to infrun, because infrun
generally doesn't need to know about that.  However, if the exiting thread was
doing a step-over (in-line or displaced), the step-over is never completed.  In
the case of an in-line step-over, the step over info is never cleared, meaning
infurn still thinks the thread is doing its in-line step, and that prevents
anything else from running.  In the case of a displaced step, the displaced
step buffer stays marked as used and is never freed for another thread to use,
which leads to a similar deadlock.

I'll attach a test case that reproduces the issue.

A possible solution is for targets to voluntarily report thread exit events
when the exiting thread was being stepped.  Infrun would then have a chance to
do the appropriate cleanup, and that wouldn't require enabling thread events
for the whole target.

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-11-13 15:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 20:00 [Bug gdb/27338] New: Stepping over a breakpoint on an instruction that makes the thread exit is not correctly handled simark at simark dot ca
2021-02-03 20:00 ` [Bug gdb/27338] " simark at simark dot ca
2021-02-03 21:37 ` simark at simark dot ca
2022-06-21 11:24 ` pedro at palves dot net
2023-03-27 16:20 ` cvs-commit at gcc dot gnu.org
2023-11-13 14:26 ` cvs-commit at gcc dot gnu.org
2023-11-13 14:26 ` cvs-commit at gcc dot gnu.org
2023-11-13 14:26 ` cvs-commit at gcc dot gnu.org
2023-11-13 14:26 ` cvs-commit at gcc dot gnu.org
2023-11-13 14:27 ` cvs-commit at gcc dot gnu.org
2023-11-13 15:03 ` pedro at palves dot net

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).