[Gc] Re: Program broken

Hugh up2dream at gmail.com
Wed Sep 23 09:01:13 PDT 2009


Ivan Maidanski <ivmai at ...> writes:

> 
> Hi!
> 
> Hugh <up2dream at ...> wrote:
> > Hi,
> >
> > My program often broke on line marked with "*". The error is First-chance
> > exception at 0x00000000 in HostApp.exe: 0xC0000005: access violation read
> > 0x00000000 .
> >
> > Any help will be appreciated.
> >
> > inline gc_cleanup::gc_cleanup() {
> >     GC_finalization_proc oldProc;
> >     void* oldData;
> >     void* base = GC_base( (void *) this );
> >     if (0 != base)  {
> >       // Don't call the debug version, since this is a real base address.
> > ********      GC_register_finalizer_ignore_self( *****
> >         base, (GC_finalization_proc)cleanup, (void*) ((char*) this - 
(char*)
> > base),
> >         &oldProc, &oldData );
> 
> There is no pointer dereference in this line, so it shouldn't produce SEGV.
> I guess you mean the SEGV is somewhere in GC_register_finalizer_ignore_self
(), right? If yes, could you
> point to that place?
> 
> >       if (0 != oldProc) {
> >         GC_register_finalizer_ignore_self( base, oldProc, oldData, 0, 
0 );}}}
> 
> Bye.
> 
It's terrible. I can't step into that function.
I think it may be that gc collect sth. that shouldn't be collected. How can I 
know a object is already collected? Or have you some skill on debug it ? My 
Env is WinCE 6.

thanks a lot.



More information about the Gc mailing list