From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 960CD385841D; Wed, 17 Apr 2024 14:52:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 960CD385841D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713365531; bh=jUPd/nv3tAU+duZnuWy5lQ/rGQF8pyb8yiv4yAzJA2c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rKCx73RSR1SDqMs9RHodeQ19+h3gCM4glhOBkLRODKshsXYjS6CfxpXh/Cipqe1zw cUA3Ahrlh2+CvYF5lTmofdTwir9Ntw4r4iWTlHk2AAxeuFR6vURZopNMLbddCZ8+8D DyA5a+jISbtX71XuO6BEfZ9tydQk4D43MSLwJ0ho= From: "pedro at palves dot net" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: testsuite X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pedro at palves dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: cel at linux dot ibm.com X-Bugzilla-Target-Milestone: 15.1 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31312 Pedro Alves changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro at palves dot net --- Comment #27 from Pedro Alves --- > I did reach out to the kernel community about this. There are some timin= g issues=20 > that can cause the kernel to legitimately return EPERM. He pointed me to= the ptrace=20 > Linux man page. Another possible cause for the EPERM is if ptrace is alr= eady=20 > connected to the process. I tried to determine if this was in fact the c= ase.=20=20 > Specifically if the detach hadn't completed yet but was not able to show = that was the=20 > failure case.=20=20 I'm not convinced the kernel folks understood the issue completely. The pt= race man page doesn't talk about timing issues wrt EPERM. Also, if the attach f= ails with EPERM due to a timing issue, then sleeping a while and then trying aga= in 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.=20=20 > I don't see any gdb attached thread status command that would verify it.= =20 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. --=20 You are receiving this mail because: You are on the CC list for the bug.=