This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH/7.10 2/2] gdbserver: Fix non-stop / fork / step-over issues
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 03 Aug 2015 17:20:12 +0100
- Subject: Re: [PATCH/7.10 2/2] gdbserver: Fix non-stop / fork / step-over issues
- Authentication-results: sourceware.org; auth=none
- References: <1438362229-27653-1-git-send-email-palves at redhat dot com> <1438362229-27653-3-git-send-email-palves at redhat dot com> <86a8u8e754 dot fsf at gmail dot com>
On 08/03/2015 04:14 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> I fixed some of these issues recently, but there's a lot more to
>> do. Fixing that one just exposes other similar problems elsewhere.
>> Meanwhile, I've filed PR18749 and kfailed the test for native.
>
> This test case also exposes the issue on arm-linux with gdbserver,
>
> (gdb) PASS: gdb.threads/fork-plus-threads-2.exp: detach-on-fork=on: continue &
> [New Thread 29905]^M
> [New Thread 29900]^M
> [New Thread 29895]^M
> [New Thread 29898]^M
> [New Thread 29902]^M
> [New Thread 29896]^M
> [New Thread 29903]^M
> [New Thread 29901]^M
> [New Thread 29899]^M
> [New Thread 29904]^M
> [New Thread 29897]^M
> Error in testing breakpoint condition:^M
> Cannot access memory at address 0x11094^M
> FAIL: gdb.threads/fork-plus-threads-2.exp: detach-on-fork=on: inferior 1 exited
Ah, OK, so I guess it'll fail on all targets where gdbserver
does not handle the breakpoint condition server-side.
> Remote debugging from host 127.0.0.1^M
> ^M
> Child exited with status 0^M
> GDBserver exiting^M
> ../../binutils-gdb/gdb/thread.c:936: internal-error: finish_thread_state: Assertion `tp' failed.^M
> A problem internal to GDB has been detected,^M
> further debugging may prove unreliable.^M
> Quit this debugging session? (y or n) monitor exit^M
> Please answer y or n.^M
> ../../binutils-gdb/gdb/thread.c:936: internal-error: finish_thread_state: Assertion `tp' failed.^
I've seem this too while developing the patch. I saw it happen when the
connection is abruptly closed while there's a finish_thread_state cleanup
installed (while gdb is handling an event, within fetch_inferior_event). The
connection-close deletes all threads, and the cleanup wants to finish the
state of a now-nonexisting thread. See [palves/fork_stale_running] on my github.
Thanks,
Pedro Alves