Re: bad c++ (or bug 596)


Subject: Re: bad c++ (or bug 596)
From: Mike Nordell (tamlin@algonet.se)
Date: Wed May 10 2000 - 20:27:27 CDT


> > > The code making the bad call is
> > >
> > > m_pViewSelection->cmdUnselectSelection();
> > >
> > > And indeed, GDB tells us that m_pViewSelection is of type AV_View.
> >
> > I suppose GDB gets this by looking at the vtable ptr. Could it be
> > that the concrete view have been destructed? In that case the
> > dangling pointer would contain the vtable ptr to the topmost
> > baseclass, since it gets set in that class' d'tor.
>
> More info:
>
> This is where the real initialization takes place.
>
> src/wp/ap/unix/ap_UnixApp.cpp:470: m_pViewSelection = pView;

If you put a breakpoint there, is pView pointing at a concrete object?

> Now, this gets called once prior to the crash - when you make the
> original selection (makes sense, since it is in setSelectionStatus() ).

And it only gets called from ap_UnixViewListener::notify.
I still suspect that the crash is due to the object having been
destructed.

An idea, in AV_View d'tor, set any of its member values to a known kad
value, e.g.
  m_yScrollOffset=0x4711;

Armed with this, you can make sure that the object is indeed a "live"
object, or that it in fact have been deleted in the crashing call.



This archive was generated by hypermail 2b25 : Wed May 10 2000 - 19:27:18 CDT