This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: pthread_cancel/pthread_join deadlock
- From: Martin Koegler <martin dot koegler at chello dot at>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: Martin Koegler <martin dot koegler at chello dot at>, libc-help at sourceware dot org
- Date: Fri, 20 Dec 2013 09:18:54 +0100
- Subject: Re: pthread_cancel/pthread_join deadlock
- Authentication-results: sourceware.org; auth=none
- References: <20131219214404 dot GA24620 at mail dot zuhause> <CALoOobO-4jwCgws7HmXZgkeKu43n7PAAoyq_=Kj5cRpGK2AXxw at mail dot gmail dot com>
On Thu, Dec 19, 2013 at 02:37:41PM -0800, Paul Pluzhnikov wrote:
> On Thu, Dec 19, 2013 at 1:44 PM, Martin Koegler
> <martin.koegler@chello.at> wrote:
> > The following test programs produces very likley a lockup, if it is started via GDB:
>
> Does it ever lockup when running outside of GDB?
Inside GDB, it happens very likely. Without GDB, it keeps running for minutes.
If GDB losses signals, this could explain the behaviour:
__pthread_disable_asynccancel starts waiting for the SIGCANCEL signal,
but SIGCANCEL never reaches the signal handler.
> We've recently found a gdbserver-induced lockup:
> https://sourceware.org/ml/gdb-patches/2013-11/msg00361.html
>
> This may be a similar bug in the GDB itself.
>
> The deadlock didn't reproduce for me under current trunk GDB and trunk
> GLIBC on Linux/x86_64.
Will retry with GDB trunk, as the relevant files have not really changed:
http://repo.or.cz/w/glibc.git/history/64a17f1adde4715bb6607f64decd73b2df9e6852:/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
http://repo.or.cz/w/glibc.git/history/64a17f1adde4715bb6607f64decd73b2df9e6852:/nptl/nptl-init.c
http://repo.or.cz/w/glibc.git/history/64a17f1adde4715bb6607f64decd73b2df9e6852:/nptl/pthread_cancel.c
http://repo.or.cz/w/glibc.git/history/64a17f1adde4715bb6607f64decd73b2df9e6852:/nptl/pthread_join.c
Regards,
Martin