From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F2CCF3851C25; Thu, 19 Nov 2020 23:55:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F2CCF3851C25 From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/26754] Race condition when resuming threads and one does an exec Date: Thu, 19 Nov 2020 23:55:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2020 23:55:38 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26754 --- Comment #9 from Simon Marchi --- (In reply to Pedro Alves from comment #8) > >> I would prefer to preserve gdb thread id =3D=3D 1 before / after exec, > >> but that's a GDB concern, not a kernel interface concern. > > I don't understand what you mean here. >=20 > If we delete the zombie leader in reaction to PTRACE_EVENT_EXEC_BEGIN, th= en > when we get the PTRACE_EVENT_EXEC, we'll create a new thread for the new > leader, and that will end up with a GDB tid !=3D 1. >=20 > 1.1 main () > * 1.2 thread() >=20 > and after exec we have: >=20 > * 1.3 main () >=20 > I'm thinking that it would be better to end up with: >=20 > * 1.1 main () >=20 > Similar to how if a non-threaded program execs, the main thread's thread > number doesn't change. Ah yeah of course, we definitely want that behavior. I don't fully underst= and what you say (I would need to go study the code), but it doesn't matter rig= ht now, it's all internal GDB bookkeeping. --=20 You are receiving this mail because: You are on the CC list for the bug.=