Re: Program fault in-between two machine instructions
- From: "Toh Sain" <tohsain5165@xxxxxxxxx>
- Date: Wed, 21 Sep 2005 15:55:23 -0400
"Oleg Starodumov" <com-dot-debuginfo-at-oleg> wrote in message
news:%2313JgG3tFHA.904@xxxxxxxxxxxxxxxxxxxxxxx
>
> > Can a crash occur at a location in-between two machine instructions?
> >
> > After my program crashed, my program-generated crash log indicated the
crash
> > occurred at the instruction at offset 85 hex in the function a portion
of
> > which I am posting below:
> >
> > 00078 8b 56 78 mov edx, DWORD PTR [esi+120]
> > 0007b 8d 4e 78 lea ecx, DWORD PTR [esi+120]
> > 0007e ff 52 20 call DWORD PTR [edx+32]
> > 00081 8b 86 b4 00 00 00 mov eax, DWORD PTR [esi+180]
> > 00087 8d 8e b4 00 00 00 lea ecx, DWORD PTR [esi+180]
> > 0008d ff 50 20 call DWORD PTR [eax+32]
> >
> > The above code was generated by Visual Studio with the /FAcs option. As
you
> > can see, no instruction starts at 85 hex. I verified that the code that
> > crashed was same version as I compiled to get the listing. So my
question
> > is, does the value of the instruction pointer (85 hex) itself indicate a
> > problem?
>
> Yes, it can indicate a problem. This situation can happen when control
> is transferred to a wrong place in the code.
>
> Some possible reasons can be:
> - Stack corruption (e.g. buffer overwrite into an area where a pointer is
stored,
> e.g. return address of a function)
> - Function call through a bad pointer
> - Heap corruption (e.g. vtable pointer of a C++ object stored on the heap
> can be corrupted)
> - Function prototype mismatch
>
> Do you have any other information about the crash? (In addition to the
address
> of the failed instruction - e.g. registers, call stack, etc.?)
>
> Regards,
> Oleg
> [VC++ MVP]
>
Oleg, thank you for your reply. I found out the problem - it was incorrect
interpretation of the linker map. I was subtracting the program load point
(0x00400000) but neglecting the offset for the Portable Executable header
(0x1000). When I subtracted another hex 1000, I found an instruction
starting at that address.
See http://www.codeproject.com/debug/mapfile.asp
Best, TS
.
- References:
- Program fault in-between two machine instructions
- From: Toh Sain
- Re: Program fault in-between two machine instructions
- From: Oleg Starodumov
- Program fault in-between two machine instructions
- Prev by Date: have way to debug Service in remote machine?
- Next by Date: debug 98 remotely from xp
- Previous by thread: Re: Program fault in-between two machine instructions
- Next by thread: MFC42D.DLL Access violation
- Index(es):
Relevant Pages
|