This person:

virtual phTreeClass* GetTreeClass() const { return (phTreeClass*)m_entity_class; }

When known as, crashed this program by having an access breach, despite a complete recompile. All member functions and virtual member functions had correct memory adresses (I hovered mouse within the techniques in debug mode), but this function were built with a bad memory adress: 0xfffffffc.

Everything looked okay: the 'this' pointer, and everything works fine up to this function call. This function can also be pretty old and that i did not change it out for any very long time. The issue just all of a sudden put their hands up after a little work, that we said all to see that which was doing the work, with no success.

And So I removed the virtual, put together, and delay pills work fine. I add virtual, put together, also it still works fine! I essentially transformed nothing, and don't forget which i did perform a full recompile earlier, but still had the mistake in those days.

I wasn't in a position to reproduce the issue. But it is now back. I did not change anything. Getting rid of virtual fixes the issue.



Do not ever use C-style casts with polymorphic types unless of course you are seriously certain of what you are doing. The overwhelming probability is you cast it to some type it wasn't. In case your pointers don't unconditionally cast (simply because they cast to some base class, that is safe) then you are doing the work wrong.

Compilers and linkers are programs compiled by human like every other, and therefore naturally can't be error-free..

We from time to time encounter such inexplicable issues and fixes too. There is a myth on offer here that removing the ncb file once fixed a build..

Considering that recompiling initially fixed the issue, try carrying out a full neat and rebuild first.

In the event that fails, it looks very likely that despite the fact that your this pointer seems correct for you, it is actually erased/deconstructed and pointed at garbage memory that simply transpires with seem like the actual object which was there before. If you are using gdb to debug, the very first word in the object's pointer would be the vtable. Should you choose an x/16xw <addr> (for instance) memory dump at this location gdb will explain what kind of object's vtable resides there. Whether it's parents-most type then your object is certainly gone.

Alternately when the this pointer isthe same any time you can put a breakpoint within the class destructor using the condition that this == known_addr.