#### Archived

This topic is now archived and is closed to further replies.

# HeapAlloc causes stopping at "user breakpoint" in debug mode

## Recommended Posts

Halloween    122
I''ve got the situation, when HeapAlloc, which is called from some STL memory allocator, stops at the
  DbgBreakPoint: int 3 ret 
In release mode it causes stack overflow, though there are no any recursion in the code, and there are no lots of auto variables. I''m using STL heavily while managing my data structures. What can be the origin of wrong heap operation in such a case?

##### Share on other sites
Stoffel    250
When you hit that breakpoint, pop up the stack to your code. Are you trying to allocate something insanely big?

99% of the time, STL, win32 and the core C/C++ libraries are not to blame. They have these checks in them that will cause your debugger to stop inside these functions when they detect they''re not being used properly. Many do not understand this, and say "there''s an error in STL/MFC/HeapAlloc" when really that breakpoint is to let you know that the calling code (e.g. user code) is in error.