this one has cost me a good part of my sanity. After hours of painful trial and error I was able to create a minmal sample:
Symptoms: The compiled application crashes due to an allegedly uncaught exception. However the exception should be catched, as can be seen in the sourcecode.
1. get MinGW latest repository catalogues (GCC 4.62) via automatic installer
2. Create a new CodeBlocks console project
3. Set optimization to O3 - this is important!
4. integrate file "main.cpp" from the attachment
Alternative: load test.cbp directly from attachment. However note that this is nothing more than steps 1 -4.
5. Compile, start and let it crash.
This example is *really* minimal. If I make any change, the bug is not reproducible anymore, for example:
- Set optimization to O2 instead of O3 -> no crash
- Set size of char array "errorMessage" to 2000 instead of 20000 -> no crash
- use an older compiler from automatic installer: pre-packaged repository catalogues 20110802 -> no crash
- remove any of the other seemingly unused or superfluous pieced of code -> no crash
- This is not some theoretical problem, actually my users currently suffer from application crashes that can be attributed to this bug.
- Windows7 x64,
- latest repository catalogues (GCC 4.62) complete new install as of today, for the purpose of verification
- IDE: Codeblocks nighly