malloc patch for 2.2.4

Wolfram Gloger Wolfram.Gloger@dent.med.uni-muenchen.de
Wed Aug 22 06:31:00 GMT 2001


Hello,

> free() and exit() are not atomic operations and may not be called

s/atomic/async-signal-safe/

> after a fork() in the newly-created child process.---At least SUSv2
> says so,

I know.  But this is truely useless, we should attempt to allow this,
other systems have implemented this as well.  Anyway, this is a
separate issue.

> and the libc documentation doesn't mention that all
> subsystems are locked across a fork().

Nevertheless we (rightly) try to achieve this as far as possible,
malloc and stdio mutexes are locked across fork.

> > Anyway, the problem occurs even if the fork()ed child does just an
> > exit(0)!
> 
> exit() invokes all functions registered via atexit().  It is not very
> surprising that this doesn't work.  Have you tried _exit() instead?

Doesn't matter, I don't use atexit() functions -- but, most important,
for my test case the mysterious crashes happen in the _parent_
multi-threaded application, not in the forked child.

Regards,
Wolfram.



More information about the Libc-alpha mailing list