Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Nov 2020 21:18:10 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 250954] ptrace(): weird ordering between inheriting debug registers and reporting a new thread
Message-ID:  <bug-250954-227-7GzHuCMceg@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-250954-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-250954-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D250954

--- Comment #16 from Konstantin Belousov <kib@FreeBSD.org> ---
(In reply to Pavel Labath from comment #15)
Do you mean that events channel for Linux debugging facility is per-thread ?

In FreeBSD, ptrace(2)/waitpid(2) report all process events, with proper
qualification when it comes from specific thread.  As result, we do not rea=
lly
need pre-notification about new thread to be created.  ptrace() produces a =
stop
in the context of new thread before it executes first userspace instruction,
informing debugger about lwpid and allowing it to make changes to the thread
state before it ever has chance to execute.

I suspect that the race that we discussed there either handled somewhat
different
in Linux, or exists in Linux as well.  It is between the event from the con=
text
of the new thread, and kernel taking snapshot of the state of the parent th=
read
to set child state.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-250954-227-7GzHuCMceg>