Re[6]: [Gc] Segfault in GC_mark_from

Ivan Maidanski ivmai at mail.ru
Thu Oct 23 01:08:10 PDT 2008


Hi!

"Bruce Hoult" <bruce at hoult.org> wrote:
> 
> 2008/10/23 Ivan Maidanski <ivmai at mail.ru>:
> > Hi!
> >
> > "Bruce Hoult" <bruce at hoult.org> wrote:
> >>
> >> 2008/10/23 Ivan Maidanski <ivmai at mail.ru>:
> >> > So, I think, GC_general_register_disappearing_link() should be changed either:
> >> > - by adding an assertion for obj argument (HDR(obj) != NULL); or
> >> > - by doing the same as in GC_register_finalizer_inner() ("if (hhdr == NULL) return 0").
> >>
> >> GC_register_disappearing_link() has the additional sanity checking you ask for.
> >>
> >
> > I can't see this saninity checking (at least in the current CVS) - the only action done with obj in GC_general_register_disappearing_link() is HIDE_POINTER(obj).
> 
> GC_API int GC_register_disappearing_link(void * * link)
> {
>     ptr_t base;
> 
>     base = (ptr_t)GC_base((void *)link);
>     if (base == 0)
>     	ABORT("Bad arg to GC_register_disappearing_link");
>     return(GC_general_register_disappearing_link(link, base));
> }
> 

Sorry, but I'm talking about GC_general_register_disappearing_link() (and GC_GENERAL_REGISTER_DISAPPEARING_LINK() macro having its own check in debug mode but nevertheless useless for my case since obj is not even checked for NULL in the body of the func), not about GC_register_disappearing_link() (which is ok).

Bye.



More information about the Gc mailing list