- 3D Stuff (9)
- BumpTop (5)
- C/C++ (16)
- Open Source (6)
- Radiant (8)
- Seneca (4)
- Stuff (11)
- Uncategorized (14)
- win32 (11)
- November 10, 2008: Radiant Update
- October 28, 2008: Primary Export: Pain
- September 7, 2008: Results
- September 5, 2008: Multicore Processing And Game Engines
- July 31, 2008: Work++; // Again!
- June 8, 2008: Patterns And Such.
- June 4, 2008: Work++;
- May 20, 2008: SIMD And Randomness
- April 30, 2008: Coder Burn-Out
- March 26, 2008: Some GameDev Math Resources.
Exceptions Con’t
The problem with using SEH (As talked about in my previous blog) is that it does not catch any debugging information that is included inside any of the STL headers. I ran into this problem last night when trying to test the crash handler and I was baffled to see that my program was crashing outright and the crash handler did not work. I tracked the problem down to STL’s Vector class. When compiled in Release mode, the Vector class still contained debugging information which allowed the Just-In-Time (JIT) debugger to kick in and attempt to debug the application. This is bad because the JIT debugger has priority over any other exception handling. Consequentially, the crash handler was not fired and the mini dump was not created and emailed.
So how does one fix this? Actually its just a one-liner. Just by defining this before you include the Vector class removes the debugging code form compilation:
#define _SECURE_SCL 0
#include <vector>
In addition, the debugging code inside the Vector class is all over the place. It will literally remove a massive chunk of assembly code from the executable (and in the case of games, it will push out an extra 20fps or so). Having safety inside STL is nice when you do not have a crash handler, but it can create problems. However, it does compromise security because if you create a buffer overflow, it is easy to exploit that. I would suggest that if your interested in knowing more about this, check out this article, and the MSDN article on Checking Iterators.
Leave a Reply
You must be logged in to post a comment.