So I've run into a seemingly random issue where my software is closing out (almost as if I clicked the X button). After some digging via Windows Event error reporting I realized this was because of a heap corruption.
Unfortunately, the issue seems to only happen under certain unknown conditions. It happens frequently in my production environment (once every 2-3 days, when my customers are using it), but has yet to happen to me while trying to debug the issue on my development environment.
I found this article, on how to find the source of the corruption... but enabling page heaps is causing the software to be unbearably slow (something I can't introduce into the production environment).
Visual Studio - how to find source of heap corruption errors
This is leaving me at a loss on what to do...
Does anyone have any other methods of detecting the source of a heap corruption in a production/release build that doesn't drastically effect performance? Ideally it detects the point of corruption, creates a DMP at the location in the code it occurred, and then continues with normal execution (even if that means crashing/closing out after the DMP is made).
For some context, this software is made using C++ and with Visual Studio 2022.