Tracing a windows run time error
Posted on 2001-08-15
This question at end of this message...
The previous question:
I wrote a C++ program in using Visual Studio that usually runs fine. I have given a "win32 release"
build copy to my users.
It occasionally crashes and give the users an "Illeagal Operations" message box.
Ho do I use the data from this message box to figure out where in my program the crashing is initiated
(using the debugger of course) - so I can try and fix it!
The previously accepted answer (from jhance):
The stack traceback is quite useful. Be sure you have the EXACT build that caused the crash and be
sure you have the MAP and COD files being generated by your release build. These are not on by default.
1) Starting at the EIP, find that address RANGE in your MAP file. It will say what obj file had that
address. If it's one of your files, then continue. Othwise go to the stack traceback and work from
the top of the list down until you find an address RANGE that relates to some code you wrote.
2) Now, calculate the OFFSET from the address in the crash report from the beginning of the obj module.
Also note the NAME of the function in the MAP file. It will be a decorated name.
3) Now open the COD file for the obj you've located. Find the function by name that you located in
the MAP file. Then move forward the number of bytes you calculated in the offset.
4) You've arrived at the SOURCE CODE LINE that caused the fault. Usually the problem is obvious.
Here is the question:
I have all the MAP and COD files and the details of the error message - but I cant seem to find from all this the like of my code that caused the problem. I would like to send someone the three files and see if they can make something of it.