public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/31440] [gdb] FAIL: gdb.python/py-progspace-events.exp: inferior 1 (timeout)
Date: Mon, 04 Mar 2024 10:54:51 +0000	[thread overview]
Message-ID: <bug-31440-4717-G1q6AcYd81@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31440-4717@http.sourceware.org/bugzilla/>

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

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
I added some debug printfs, and got the following output.

Passing case:
...
(gdb) PASS: gdb.python/py-progspace-events.exp: continue to breakpoint: run to
breakpt in inferior 2
continue^M
Continuing.^M
not removable: inf 1^M
not deletable: inf 2^M
[Inferior 2 (process 4549) exited normally]^M
not removable: inf 1^M
not deletable: inf 2^M
(gdb) not removable: inf 1^M
not deletable: inf 2^M
PASS: gdb.python/py-progspace-events.exp: continue until inferior 2 exits
inferior 1^M
[Switching to inferior 1 [process 4546] (py-progspace-events)]^M
[Switching to thread 1.1 (process 4546)]^M
#0  breakpt () at py-progspace-events.c:28^M
28      { /* Nothing.  */ }^M
(gdb) PASS: gdb.python/py-progspace-events.exp: inferior 1
step^M
not deletable: inf 1^M
delete_inferior: inf 2^M
FreeProgspaceEvent: <gdb.Progspace object at 0x7efd1faf0ee0>^M
...

Failing case:
...
(gdb) PASS: gdb.python/py-progspace-events.exp: continue to breakpoint: run to
breakpt in inferior 2
continue^M
Continuing.^M
not removable: inf 1^M
not deletable: inf 2^M
[Inferior 2 (process 4752) exited normally]^M
not removable: inf 1^M
not deletable: inf 2^M
(gdb) PASS: gdb.python/py-progspace-events.exp: continue until inferior 2 exits
inferior 1^M
[Switching to inferior 1 [process 4742] (py-progspace-events)]^M
[Switching to thread 1.1 (process 4742)]^M
#0  breakpt () at py-progspace-events.c:28^M
28      { /* Nothing.  */ }^M
(gdb) not deletable: inf 1^M
delete_inferior: inf 2^M
FreeProgspaceEvent: <gdb.Progspace object at 0x7f3a6faf0ee0>^M
FAIL: gdb.python/py-progspace-events.exp: inferior 1 (timeout)
step^M
...

So, it seems there's a race between some event and the "inferior 1" command.

In the passing case, the event is handled first.  During handling,
prune_inferiors is called, but it can't remove inferior 1, because it's still
the current one.

In the failing case, the "inferior 1" is handled first. Then during handling of
the event, prune_inferiors is called, and it can remove inferior 1 because it's
no longer the current one.

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

  parent reply	other threads:[~2024-03-04 10:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-02  7:14 [Bug testsuite/31440] New: [gdb/testsuite] " vries at gcc dot gnu.org
2024-03-03 11:40 ` [Bug testsuite/31440] " vries at gcc dot gnu.org
2024-03-04  8:25 ` [Bug gdb/31440] [gdb] " vries at gcc dot gnu.org
2024-03-04  8:58 ` vries at gcc dot gnu.org
2024-03-04  9:31 ` vries at gcc dot gnu.org
2024-03-04 10:54 ` vries at gcc dot gnu.org [this message]
2024-03-04 10:58 ` vries at gcc dot gnu.org
2024-03-04 12:21 ` vries at gcc dot gnu.org

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-31440-4717-G1q6AcYd81@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).