This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: debug of multithreaded program turns to be impossible during execution
- From: Pedro Alves <palves at redhat dot com>
- To: Avi Gozlan <avi at checkpoint dot com>, "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Thu, 31 Jul 2014 11:17:25 +0100
- Subject: Re: debug of multithreaded program turns to be impossible during execution
- Authentication-results: sourceware.org; auth=none
- References: <71C49BB0B847984EAADFE43F93C6BF083ADA7BE0 at DAG-EX10 dot ad dot checkpoint dot com>
On 07/31/2014 10:27 AM, Avi Gozlan wrote:
> Hello,
>
> I'm debugging a multithreaded program using GDB. Various threads are created and exit during execution. GDB copes successfully with the multiple threads (e.g. 'thread apply 3 bt' reports successfully backtrace of thread 3), but then at one point loses control of the program:
>
> (gdb) c
> Continuing.
> [New Thread 0x41401940 (LWP 13370)]
> [Thread 0x40a00940 (LWP 13333) exited]
> [New Thread 0x41e02940 (LWP 13371)]
> ...
> [New Thread 0x45a08940 (LWP 13377)]
> [New Thread 0x46409940 (LWP 13378)]
> [Thread 0x41e02940 (LWP 13371) exited]
> [Switching to Thread 0x45a08940 (LWP 13377)]
> Cannot remove breakpoints because program is no longer writable.
> Further execution is probably impossible.
> 0x00002aaaab98348f in start_thread () from /lib64/libpthread.so.0
> ptrace: No such process.
>
> Surprisingly, although debugging is no more possible, the program is not dead:
I have a vague recollection that this was fixed a while ago. Like,
GDB was picking the wrong thread to access memory, and it ended up
picking a running or exited thread, and that fails (in either
case ptrace complains the same say).
> GDB version: 7.6
Is there a chance you could try a more recent GDB version? Ideally
7.8, which we just released.
Thanks,
Pedro Alves