[Gc] Re: Problem pthread_atfork

Manuel.Serrano at inria.fr Manuel.Serrano at inria.fr
Tue Mar 27 00:25:52 PST 2012


Hi Ivan,

> Mon, 26 Mar 2012 18:55:43 +0200 Andy Wingo <wingo at pobox.com>:
> > On Mon 26 Mar 2012 14:59, Ivan Maidanski <ivmai at mail.ru> writes:
> > 
> > > 1. provide configure --enable/disable-handle-fork trigging [NO_]HANDLE_FORK
> > 
> > Sure, will do.
> 
> Thanks. Although it is ok to pass it via CFLAGS, --enable-x is more uniform way.
> 
> The alternative solution could be use of dlopen or weak symbols (but it is quite target-specific).
> 
> Another solution is to let the client decide whether fork should be handled by GC at runtime (in case the client rely on memory allocation after fork)?
> (E.g., export GC_fork_prepare/parent/child_proc).
> 
> Yet more solution is to redirect fork to GC_fork (which calls prepare, fork, parent/child). Looks to me the best way.
> Your opinion?
> 
> > 
> > > 2. if no such option given, test atfork availability (by linking a code snippet with pthread_atfork).
> > 
> > Is this possible?  Surely Manuel succeeded in compiling libgc and its
> > tests, and the problem only occurred when he went to link libgc to a
> > program of his that does -lpthread.
> 
> This is unclear to me: he linked to some custom pthread implementation (which has atfork hidden).
Just to avoid misunderstanding...

The blog I was referring to mentioned the PPC implementation but
actually we saw the problem with a regular Linux Mint distribution. On
that machine we use the standard pthread library. It appears that the
error message we got is exactly similar to the one reported on the blog.

I hope this helps clarifying the problem.

Regards,

-- 
Manuel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
Url : http://napali.hpl.hp.com/pipermail/gc/attachments/20120327/2db197e4/attachment.pgp


More information about the Gc mailing list