I have a Windows application, it crashes every now and then and not reroducibly.
When it does, I get pure virtual function called. I have set it up to create a Windows dump using ADplus and even when it crashes, there is never a dump.
I am pretty sure this is build error, I am building using VC2008 SP1 and this is the release build.
Any insights on this? How can I debug this, it is a release build with .pdb file and map file.
Thanks
Reza
As was pointed out already, it is very unlikely that this is a build error. I had a quite complex project with a similar problem and was able to track it down by using
_set_purecall_handlerand providing my own handler. This way I was able to break into the debugger when it happened and see the call stack. Obviously an alternative here is to create the minidump when it happens. Remember that you need to prepare everything for the minidump before the program encounters an exception.However, there is also a good chance this could be caused by a heap corruption. In such a case I would expect a variety of symptoms, though. You describe this specific symptom, so it’s likely that your code is indeed at fault.
The project I mentioned above was a legacy project that modeled something similar to COM and there were indeed places where the compiler could not have possibly found all occasions of pure virtual functions for which no implementation existed in derived classes.