threading/malloc/fork interaction -> hang

Stephen Warren swarren at wwwdotorg.org
Wed Nov 2 23:24:17 UTC 2005


Stephen Warren wrote:
> I'm seeing a hang in our application that appears to be caused by a
> uClibc problem. Currently, I'm using 0.9.27, but I don't see any obvious
> changes in SVN that would fix this.
> ...

We applied this patch to uClibc-0.9.27 and the problems appear to be
fixed...

Some issues with this patch right now:

* May only work for the one malloc implementation we use - I didn't
check the others to see if they use the same variable name, or even
technique, for protecting the heap with a lock.

* The calls that the fork parent process makes should probably be
registered into the atfork function lists for cleanliness

* The child functions can't be registered as atfork functions, since the
extra code needs to run immediately after the fork returns, not after
the extra pthreads code that cleans everything up

Comments?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20051102/bd4d4e61/attachment.pgp 


More information about the uClibc mailing list