Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jan 2007 16:36:57 -0300
From:      Daniel Molina Wegener <dmw@unete.cl>
To:        freebsd-hackers@freebsd.org, Daniel Eischen <deischen@freebsd.org>
Subject:   Re: strange pthread keys behavior
Message-ID:  <200701071636.57861.dmw@unete.cl>
In-Reply-To: <Pine.GSO.4.64.0701071028040.5044@sea.ntplx.net>
References:  <200701070834.21711.dmw@unete.cl> <Pine.GSO.4.64.0701071028040.5044@sea.ntplx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 07 January 2007 12:44, Daniel Eischen wrote:
> [SNIP]
> >
> >   =BFIs this a mistake in the code or a standard warning in
> > FreeBSD pthreads?
>
> Yes, it looks like a buggy program...
>
> >   The code bellow can be compiled with and do not use the
> > pthread_key_delete routine:
>
> See the POSIX spec with regard to pthread_key_create():
>
>  =20
> http://www.opengroup.org/onlinepubs/009695399/functions/pthre
>ad_key_create.html
>
> You may have to create an account (free) in order to view it.
> Also look at pthread_key_delete().
>
> I think the problem is that you are calling
> pthread_key_delete() from the thread that is creating the key
> and before the thread has exited (when the thread-specific
> key data is destroyed). You have invalidated the key by
> deleting it, so when the thread exits, it can't call the
> destructor and it iterates PTHREAD_KEY_MAX times trying to
> deallocate the key data.  That is where the error message is
> generated.

  Thanks, really...

Best regards...
=2D-=20
 . 0 . | Daniel Molina Wegener
 . . 0 | dmw at unete dot cl
 0 0 0 | FreeBSD User



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701071636.57861.dmw>