Re: [Gc] Crash with tiny static roots on darwin

Ivan Maidanski ivmai at
Wed Jul 22 22:52:31 PDT 2009


Jim Hourihan <jimhourihan at> wrote:
> Hi, I've been getting a crash during marking on darwin x86_64 if and  
> only if I link my app with a particular 3rd party framework.
> ...
> Hacking GC_dyld_image_add() I noticed that this code will add  
> sections smaller than sizeof(void*). By preventing that behavior the  
> crashing has disappeared. (The framework in question had multiple tiny  
> sections). I'm wondering if this filter should be applied in  
> GC_add_roots_inner() since clearly no reference to GC memory can be  
> stored in anything less than pointer sized regions.

Yes, I'll prepare patch for it (I think GC_remove_root() should be improved for such cases too).

> Also, it looks like GC_register_has_static_roots_callback() is not  
> implemented at all for this platform and so I started to do so only to  
> become confused by its intended usage: the docs seem to indicate that  
> its called during each collection but it seems like it should be  
> called only when adding static roots initially.

GC_register_dynamic_libraries() is called at (before) every collection unless GC_no_dls is set. What makes you think it seems like it should be called only when adding static roots initially (and what is "initially"?).

>      -Jim


More information about the Gc mailing list