This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] gdbserver: Fix harmless crash for current-lwp-dead.exp


On Fri, 02 Dec 2011 23:10:43 +0100, Jan Kratochvil wrote:
> gdb.threads/current-lwp-dead.exp with local/native gdbserver will make
> crash/coredump of gdbserver on its shutdown.
[...]
> It is because gdbserver wants to kill the thread group leader - but in this
> case there is no thread group leader, that is the purpose of the testcase.

I was wrong here, the TID == PID LWP is not a thread group leader.  It is from
clone syscall without CLONE_THREAD, therefore with separate PID/TID.  It just
belongs to the same gdbserver `struct process' as it has been caught by
PTRACE_O_TRACECLONE.

As it is not a thread group leader waitpid already completed for it without
any zombie LWP hanging, delete_lwp has been called.  This is the difference
from a thread group leader - that despite it has PID == TID the waitpid has
already completed for it.


> Hmm, do we leave the process zombie then?  Should we always
> waitpid it to reap it?

There is nothing left from the kernel point of view.


Sorry for the confusion with "thread group leader".  OK to check it in?


Thanks,
Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]