This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug threads/21117] Occasional wrong thread numbering when following an exec
- From: "palves at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Thu, 09 Feb 2017 11:00:50 +0000
- Subject: [Bug threads/21117] Occasional wrong thread numbering when following an exec
- Auto-submitted: auto-generated
- References: <bug-21117-4717@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=21117
Pedro Alves <palves at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |palves at redhat dot com
--- Comment #1 from Pedro Alves <palves at redhat dot com> ---
>From the kernel's perspective, it should be the leader lwp that hits the
breakpoint too, so either a kernel bug, or a gdb bug. From your logs, looks
like the latter.
>From the logs, we can tell that the leader/process pid is "19676":
> process 19676 is executing new program: /home/simark/build/binutils-
> ^^^^^
I think that there's a good hint here, just before the first time we see a
thread != 1:
> [New Thread 0x7ffff751a700 (LWP 19697)]
> [Thread 0x7ffff7f8b700 (LWP 19676) exited] <<<< LEADER DETECTED AS EXITED
> [New LWP 19676] <<<< LEADER RE-ADDED
> process 19676 is executing new program: <<<< STILL SAME PID
>
> Thread 10 "mi-nsthrexec" hit Breakpoint 1, main (argc=1, argv=0x7fffffffda98)
So we detected the leader as exited, deleted it (most probably in
linux-nat.c:check_zombie_leaders), and then when we get
the exec event out of the kernel, we re-add the leader thread.
This will give it a new gdb thread number.
A "set debug lin-lwp 1" log probably makes that clearer.
--
You are receiving this mail because:
You are on the CC list for the bug.