How to get a stack trace when C++ program crashes? (using msvc8/2005)

后端 未结 7 701
不知归路
不知归路 2021-02-09 13:44

Sometimes my c++ program crashes in debug mode, and what I got is a message box saying that an assertion failed in some of the internal memory management routines (accessing una

相关标签:
7条回答
  • 2021-02-09 14:48

    If you run the debug version on a machine with VS, it should offer to bring it up and let you see the stack trace.

    The problem is that the real problem is not on the call stack any more. If you free a pointer twice, that can result in this problem somewhere else unrelated to the program (the next time anything accesses the heap datastructures)

    I wrote this blog on some tips for getting the problem to show up in the call stack so you can figure out what is going on.

    http://www.atalasoft.com/cs/blogs/loufranco/archive/2007/02/06/6-_2200_Pointers_2200_-on-Debugging-Unmanaged-Code.aspx

    The best tip is to use the gflags utility to make pointer issues cause immediate problems.

    0 讨论(0)
提交回复
热议问题