From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 134A23858D35; Sun, 14 Apr 2024 17:56:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 134A23858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713117396; bh=qbEGNVklN6kdHNQ4gqkIdYDw0eUz54hfZieb09Qo4C4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=A6nLIEkxksreG1SEo8YQpW7z6vVmXI0MI3szEM8iWwEGpfStCAiEtF4VfdaUlLtkv tIJCyNeIOD19tTqfPrNPRAb5BzKOGzx+D5zHEhPNWkbmjUUXrMLWzDh25LBeTxTi9j ahqLHEoUxm29EHnh5cBrFSIMNy55gYuHLt0LgtfQ= From: "brobecker at gnat dot com" To: gdb-prs@sourceware.org Subject: [Bug testsuite/31312] attach-many-short-lived-threads gives inconsistent results Date: Sun, 14 Apr 2024 17:56:34 +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: brobecker at gnat dot com 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: 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 --- Comment #25 from Joel Brobecker --- Hi Thiago, Would you be able to share an update on this PR? As I understand it, Pedro suggested an alternative approach: I.e., in gdb, make attach_proc_task_lwp_callback return false/0 here: if (ptrace (PTRACE_ATTACH, lwpid, 0, 0) < 0) { int err =3D errno; /* Be quiet if we simply raced with the thread exiting. EPERM is returned if the thread's task still exists, and is marked as exited or zombie, as well as other conditions, so in that case, confirm the status in /proc/PID/status. */ if (err =3D=3D ESRCH || (err =3D=3D EPERM && linux_proc_pid_is_gone (lwpid))) { linux_nat_debug_printf ("Cannot attach to lwp %d: thread is gone (%d: %s)", lwpid, err, safe_strerror (err)); return 0; <<<< NEW RETURN } Have you had a chance to try that, by any chance? Thank you! --=20 You are receiving this mail because: You are on the CC list for the bug.=