bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGSEGV on recursive pthread_join


From: Jeroen Dekkers
Subject: Re: SIGSEGV on recursive pthread_join
Date: Wed, 7 Jan 2004 21:13:51 +0100
User-agent: Mutt/1.5.4i

On Tue, Jan 06, 2004 at 04:38:02PM +0100, Richard Guenther wrote:
> On Mon, 5 Jan 2004, Jeroen Dekkers wrote:
> 
> > On Mon, Jan 05, 2004 at 07:24:14PM +0100, Richard Guenther wrote:
> > > On Mon, 5 Jan 2004, Jeroen Dekkers wrote:
> > >
> > > > On Mon, Jan 05, 2004 at 05:17:47PM +0100, Richard Guenther wrote:
> > > > > I'm experiencing a weird behavior with the NPTL threads, as that my
> > > > > application (sf.net/projects/glame) segfaults upon invocation of a
> > > > > pthread_join while the main process is currently joining the thread 
> > > > > that
> > > > > tries to do the join. I.e.
> > > >
> > > > You can't join a thread more than once.
> > >
> > > I'm not doing this. I'm joining the joining thread ;) I.e. each thread is
> > > exactly joined one time (see the numbering above).
> >
> > Oh, sorry, I misunderstood you.
> 
> It was indeed the case I tried to join a thread twice - the code was just
> somehow obfuscated.  So my problem is fixed.  But still, old libc did not
> segfault in this case - can't we detect this somehow and return ESRCH
> instead?

Looking at the code i think it should return EINVAL, I have no idea
why it doesn't. But POSIX says that joining a thread twice results in
undefined behaviour, so it's not really wrong to crash, just not very
friendly.

Jeroen Dekkers




reply via email to

[Prev in Thread] Current Thread [Next in Thread]