Link to home
Start Free TrialLog in
Avatar of havannguyen
havannguyen

asked on

how to fix buffer overrun

I keep getting the massage saying that " A buffer overrun has been detected which has corrupted  the program's internal state. The program cannot safely continue execution and must now be terminated". How can I fix that problem? I'm not really good with computer so you need to show me every step clearly. Thank you.
Avatar of itsmeandnobodyelse
itsmeandnobodyelse
Flag of Germany image

First you must locate the issue in the source code. Easiest would be if the overrun occured in debug mode as well. Then, the debugger would throw an assertion and you could check the call stack to find out where the overrun had occured. It often is a strcpy or memcpy. It also could be a loop writing beyond buffer boundaries.

if it happens in release mode only it is more difficult. You could call a log function (don't forgot to flush each message or open and close the logfile with each call) at begin of each function and at end. After the termination check your logfile and you know in which function the crash happened. Then, narrow the logs until you finally have located the statement. Post it here if you don't know why it crashes.
ASKER CERTIFIED SOLUTION
Avatar of BarsMonster
BarsMonster
Flag of Belarus image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial