Re: daemon threads bug with libpthread

From: Mike Makonnen <mtm_at_identd.net>
Date: Wed, 22 Sep 2004 19:47:09 +0300
On Wed, Sep 22, 2004 at 09:05:48AM +0100, Chris Stenton wrote:
> If you create a thread before calling daemon then the next thread you
> create after the daemon call will cause the following error from the
> libpthread library.
> 
> Fatal error 'mutex is on list' at line 516 in file
> /usr/src/lib/libpthread/thread/thr_mutex.c (errno = 0)
> 
> This error does not occur if you link with -lc_r, linking with -lthr
> causes a core dump. -lthr does not look very stable.

Do you have any specific gripes with it? If so, please let
me know.

> 
> Here is some test code. I am running FreeBSD 5.3-beta
> 
> Please reply directly as I am not on the mailing list

The problem is with your test program. See the attached diff.
After you apply it, it should work as expected.

Cheers.
-- 
Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
mtm_at_identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8  5279 5359 2B82 7CD4 1F55
mtm_at_FreeBSD.Org| FreeBSD - Unleash the Daemon !

Received on Wed Sep 22 2004 - 14:47:07 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:13 UTC