FW: g_spawn_sync and threads (was: help about GC)



Forwarding at Matthias' request: 

-----Original Message-----
From: Matthias Clasen [mailto:mclasen redhat com] 
Thanks for pointing that problem out, Hans. It is probably best to send
that mail to gtk-devel-list gnome org to get some wider audience. I'm
currently on vacation...


On Fri, 2007-08-31 at 17:53 +0000, Boehm, Hans wrote, in response to a
w3m/GC inquiry:
> ...
> I looked only quickly at the source to g_spawn_sync. It eventually 
> calls g_execute in the child.  That calls g_malloc, at least if it has

> to follow a search path.  That's unsafe from a multithreaded 
> executable, which is allowed to make only async-signal-safe calls 
> between fork and exec.  There may be other problems along these lines 
> as well.  My conclusion is that g_spawn_sync is probably not safe for 
> use in multithreaded executables.  At least I couldn't find any 
> documentation about when and where it was.  (The child_setup parameter

> in the interface is also rather dubious, since that is called in a 
> context in which it must be async-signal-safe.)  In any case, it would

> be nice to document safe usage rules with threads.
> 
> Hans



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]