Advertisement Jump to content
Sign in to follow this  

C++ Dynamic Allocations issue

This topic is 3839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone, I'm debugging an application at work that has dynamic allocation issues in C++. This only occurs in release build and is seemingly nondeterministic. I managed to narrow it down to one call of the new operator where the failure occurs. Unfortunately I'm fixing legacy code here in VS6 and it appears that it is in fact throwing an exception (as opposed to null ptr) but it is not of type std::bad_alloc, only my catch all block is being hit and because of that I'm really curious of what other kind of exception can be thrown from calling new? One possibility of where the main problem may lie is that I might be dealing with a heap corruption issue, but I'm curious if that in fact can cause some other exception rather than std::bad_alloc. It can't be an access violation error because (if I'm not mistaken) that shouldn't hit my software exception handler. The other possibility is fragmentation (since this is code running at the db layer, and many small buffers are created), but then again if it were that, then the exception should really thow std::bad_alloc, but its clearly not...I wonder what this mysterious exception might be! Any suggestions, I'm trying to ascertain what my next plan of attack is (most of the battle so far has been finding the problem which is intermittent and release mode only).

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!