[Gc] Re: Fix for crash in GC_dyld_image_add and some more
ivmai at mail.ru
Thu Jul 23 11:14:17 PDT 2009
Jim Hourihan <jimhourihan at earthlink.net> wrote:
> On Jul 23, 2009, at 10:30 AM, Ivan Maidanski wrote:
> > Hi!
> > Jim Hourihan <jimhourihan at earthlink.net> wrote:
> >> Ivan, the attached patch is against the current CVS code + your
> >> patch.
> >> It only involves dyn_load.c.
> > Not clear. Do you apply only part of the patch? - it won't work in
> > this case.
> If you cvs update, apply your patch, then apply my patch you'll have
> the same state that I do. I can do something differently if you like.
> Make sense?
Discard the above, now I'm looking in your patch...
The following should be changed, I think:
1. "GC_has_static_roots_func callback" decl should be before any statement (i.e. before "if (GC_no_dls) return;");
2. also add "DCL_LOCK_STATE;" local var decl.
3. if "callback var is 0 then there's no need to execute GC_dyld_name_for_hdr();
3. replace GC_add_roots() call with
// DARWIN_DEBUG goes here...
GC_add_roots_inner((ptr_t)..., (ptr_t)..., FALSE);
4. put callback call after LOCK (since currently the callback is invoked with the alloc lock held).
More information about the Gc