We have developed some cool performance enhancements for Grace (a runtime system that enables safe multithreaded C/C++ programming). To make it easier to selectively turn them on and off, I decided to reorganize some of the code. Not a big deal – essentially splitting a few classes into some component classes and moving code around. Pretty routine stuff.
And then something odd happened.
After testing the code (debug build), and verifying that it worked fine, I re-ran the code in an optimized build, just to make sure that I hadn’t inadvertently introduced any performance regressions.
Instant segfault. For every benchmark.
In sum – crashes when optimized:
- Everything works fine in debug builds.
- Complete disaster in optimized builds.
Enter your guesses below.