Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Stack overflow and memory problem?

Status
Not open for further replies.

davyzhu

Advanced Member level 1
Advanced Member level 1
Joined
May 23, 2004
Messages
494
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Location
oriental
Activity points
4,436
When I encounter software crash, the software always pop-up something like " The instruction at "0x1000a1eb" referenced memory at "0x000000c0". The memory could not be "read"".
Then Visual C++ will ask me whether to debug the program(in assembly).

My friend told me it is mostly cause by stack overflow. Is he right?
And is there any document on how to debug it?

And how to avoid this bug in C and C++?

All the best,
Davy
 

watch your routine calls.. and return from then.. don't use junps or goto's
 

    davyzhu

    Points: 2
    Helpful Answer Positive Rating
The error message means the program is trying to read from a memory address that's not allocated to the program. That's a very common problem with a million possible causes. Usually it's caused by some sort of pointer that has run amok.

If it's your program, then compile it in debug mode, so the crash will launch the debugger and show you the offending line of source code. Hopefully the failed statement is in your code (because that's easier to debug) and not in some library or Windows function.
 

    davyzhu

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top