Exe binary crashes only outside IDE-Collection of common programming errors

Any generic advise, before I dive into the large source code?

There is something wrong in your code, which give you eventually a trouble on runtime, but only under circumstances. Which might be not so obvious, e.g. different execution timings with and without debugger and consequent thread race conditions.

Something you still want to find out quick is the crash (esp. access violation) position. If Windows shows you a window indicating crashing process with an option to debug, you want to attach your debugger an possibly see a location of the problem. A crash itself might be not the first even in a chain of issues and it’s already late to troubleshoot from there though.

Another approach is to attach a lightweight debugger, an overhead of which is smaller compared to full featured IDE debugger. For instance, you can attach LogProcessExceptions application and have a minidump file written for every exception taking place on your application. Later on, the .DMP files can be opened retrospectively by Visual Studio, and the IDE will take you to source code positions at the time of exceptions.

Then another piece of generic advice is to produce some debug output and dissect your code into fragments to isolate the problem to specific small code fragment.

In particular, if you have a suspicion that destruction runs improperly, then perhaps you are trying to use deleted memory somewhere, and to troubleshoot the problem you might want to not release memory blocks extending their lifetime and creating a memory leak: specific block used after destruction earlier will be used correctly from there and your application will stop crashing. You will be able to find out what block the crash was related to.

Originally posted 2013-11-06 03:11:21.