News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Exception trouble

Started by lamer, December 22, 2005, 10:01:14 PM

Previous topic - Next topic

lamer

Hi all!
I open file by GetOpenFileName and sometimes (rarely) the program crashes with the folowing mesage:
QuoteUnhandled exception at 0x00000000 in MyProg.exe: 0xC0000005: Access violation reading location 0x00000000.
Then I have a message box:
QuoteThere is no source code available for the current location.
with prompting to disassebling.
Clicking "yes" I see the exception on the first line:
Quote00000000  ???
What can it mean?

Thank you.

zooba

It means that at some point the code has attempted to jump to address 00000000h.

Things to check for:

jmp eax  ; or other registers or memory locations

Unbalanced stack in procedures (ie. ret tries to return to 00000000h)

Null pointers being passed to API functions (CallWindowProc et al)

Fab

Hello world, and lamer.

I had the same problem with GetOpenFileName and GetSaveFileName, it'd happen on the 3rd call to either each time I ran my program. I fixed the problem by checking over my code and making sure the stack was behaving and I was preserving the esi, edi and ebx. But also I fixed calls to GlobalFree which I was passing the wrong pointers too, after that both calls worked all the time.

Hope this helps!

lamer

Hi guys!
The phrase "There is no source code available for the current location." confused me. I expected to see at least some registers :green
After all I found the point, but it was nightmare to do.
The problem was quite usual - the pointer was outside of memory block.

Thank you