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 testsuite/31312] attach-many-short-lived-threads gives inconsistent results
Date: Wed, 17 Apr 2024 14:52:09 +0000	[thread overview]
Message-ID: <bug-31312-4717-c2OCB13hs0@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31312-4717@http.sourceware.org/bugzilla/>

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

Pedro Alves <pedro at palves dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pedro at palves dot net

--- Comment #27 from Pedro Alves <pedro at palves dot net> ---
> I did reach out to the kernel community about this.  There are some timing issues 
> that can cause the kernel to legitimately return EPERM.  He pointed me to the ptrace 
> Linux man page.  Another possible cause for the EPERM is if ptrace is already 
> connected to the process.  I tried to determine if this was in fact the case.  
> Specifically if the detach hadn't completed yet but was not able to show that was the 
> failure case.  

I'm not convinced the kernel folks understood the issue completely.  The ptrace
man page doesn't talk about timing issues wrt EPERM.  Also, if the attach fails
with EPERM due to a timing issue, then sleeping a while and then trying again
should succeed, but that is not what you observed, IIUC.

> The gdb log says that it detached from the pid.  I don't find any way to verify that.  
> I don't see any gdb attached thread status command that would verify it. 

There isn't one.  You can however look at /proc/PID/status, check the State:,
and the TracerPid: lines.  TracerPid in particular, as it tells you the pid of
the ptracer, which should be either "0" is not being traced (debugged), or
GDB's pid.

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

  parent reply	other threads:[~2024-04-17 14:52 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 18:06 [Bug testsuite/31312] New: " cel at linux dot ibm.com
2024-01-29 18:08 ` [Bug testsuite/31312] " cel at linux dot ibm.com
2024-01-29 18:20 ` tromey at sourceware dot org
2024-01-29 20:55 ` vries at gcc dot gnu.org
2024-01-29 21:35 ` cel at linux dot ibm.com
2024-01-29 21:44 ` cel at linux dot ibm.com
2024-01-29 22:38 ` cel at linux dot ibm.com
2024-01-30  7:21 ` vries at gcc dot gnu.org
2024-01-30 10:13 ` vries at gcc dot gnu.org
2024-01-31 16:14 ` cel at linux dot ibm.com
2024-02-06 18:59 ` cel at linux dot ibm.com
2024-02-12 18:58 ` tromey at sourceware dot org
2024-02-12 18:59 ` tromey at sourceware dot org
2024-02-16  4:42 ` cel at linux dot ibm.com
2024-03-09  0:45 ` tromey at sourceware dot org
2024-03-09  1:29 ` cel at linux dot ibm.com
2024-03-09  6:59 ` brobecker at gnat dot com
2024-03-09 16:43 ` tromey at sourceware dot org
2024-03-15 16:41 ` cel at linux dot ibm.com
2024-03-15 21:57 ` thiago.bauermann at linaro dot org
2024-03-16  1:37 ` thiago.bauermann at linaro dot org
2024-03-16 17:42 ` tromey at sourceware dot org
2024-03-18 18:45 ` thiago.bauermann at linaro dot org
2024-03-19 15:14 ` cel at linux dot ibm.com
2024-03-19 15:35 ` thiago.bauermann at linaro dot org
2024-03-19 15:57 ` cel at linux dot ibm.com
2024-03-19 19:10 ` thiago.bauermann at linaro dot org
2024-03-21 23:17 ` thiago.bauermann at linaro dot org
2024-04-14 17:56 ` brobecker at gnat dot com
2024-04-16  4:56 ` thiago.bauermann at linaro dot org
2024-04-17 14:52 ` pedro at palves dot net [this message]
2024-04-30  2:37 ` cvs-commit at gcc dot gnu.org
2024-05-10 22:14 ` brobecker at gnat dot com
2024-05-10 22:28 ` cel at linux dot ibm.com
2024-05-11 23:48 ` thiago.bauermann at linaro dot org
2024-05-13 19:03 ` tromey at sourceware dot org
2024-05-14 15:24 ` cel at linux dot ibm.com
2024-05-17 16:26 ` tromey at sourceware dot org
2024-05-17 16:33 ` cel at linux dot ibm.com
2024-05-17 17:10 ` vries at gcc dot gnu.org
2024-05-17 19:54 ` cel at linux dot ibm.com
2024-05-17 19:58 ` pedro at palves dot net
2024-05-17 23:02 ` cel at linux dot ibm.com

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-31312-4717-c2OCB13hs0@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).