public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "thiago.bauermann at linaro dot org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug threads/31512] gdb.threads/attach-many-short-lived-threads.exp sometimes fails with "process 2689792 is already traced by process 2039527"
Date: Tue, 19 Mar 2024 18:54:42 +0000	[thread overview]
Message-ID: <bug-31512-4717-RA4K5GS5Vh@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31512-4717@http.sourceware.org/bugzilla/>

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

--- Comment #2 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
Created attachment 15417
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15417&action=edit
gdb.log demonstrating the problem, or perhaps a similar one.

As luck would have it, I just had this result after running the testcase in
a loop 200 times. This was on an x86_64-linux machine running Ubuntu
22.04.3 LTS with kernel 5.11.0-40-generic (not sure if it's relevant).

It isn't exactly what I reported above, but it's similar enough that
perhaps it's the same bug:

[Switching to LWP 2834993]

Thread 9 "joinable" hit Breakpoint 4, break_fn () at
/home/thiago.bauermann/src/binutils-gdb/gdb/testsuite/gdb.threads/attach-many-short-lived-threads.c:57
57      }
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 4: break at
break_fn: 2
continue
Continuing.
Couldn't get registers: No such process.
(gdb) FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 4: break at
break_fn: 3
Cannot access memory at address 0x55a79be03242
(gdb) FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 4: reset
timer in the inferior
print again = 1
print seconds_left
Couldn't get registers: No such process.
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 4: print
seconds_left
[LWP 2834906 exited]
[LWP 2834941 exited]
print seconds_left
detach
Couldn't get registers: No such process.
(gdb) detach
[LWP 2440799 exited]
Detaching from program:
/home/thiago.bauermann/.cache/builds/gdb-native/gdb/testsuite/outputs/gdb.threads/attach-many-short-lived-threads/attach-many-short-lived-threads,
process 2440799
[Inferior 1 (process 2440799) detached]
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 4: detach
set breakpoint always-inserted off
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 4: set
breakpoint always-inserted off
delete breakpoints
Delete all breakpoints, watchpoints, tracepoints, and catchpoints? (y or n) y
(gdb) info breakpoints
No breakpoints, watchpoints, tracepoints, or catchpoints.
(gdb) attach 2440799
Attaching to program:
/home/thiago.bauermann/.cache/builds/gdb-native/gdb/testsuite/outputs/gdb.threads/attach-many-short-lived-threads/attach-many-short-lived-threads,
process 2440799
warning: process 2440799 is already traced by process 2440778process 2440799 is
a zombie - the process has already terminated
ptrace: Operation not permitted.
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 5: attach

The reason I'm not sure it's the same problem is that this is the first
time I saw the message "Couldn't get registers: No such process.", and also
the first time I saw the message "warning: process 2440799 is already
traced by process 2440778" being followed by "process 2440799 is a zombie -
the process has already terminated".

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

      parent reply	other threads:[~2024-03-19 18:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19 18:17 [Bug threads/31512] New: " thiago.bauermann at linaro dot org
2024-03-19 18:28 ` [Bug threads/31512] " thiago.bauermann at linaro dot org
2024-03-19 18:54 ` thiago.bauermann at linaro dot org [this message]

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-31512-4717-RA4K5GS5Vh@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).