P
paul-shed
Hello,
I have rather a nasty problem with my code which occasionally generates an
access violation when reading from memory. The address of the access
violation is not 0, it's different every time, but the address is outside of
the process memory space. So clearly there is a problem.
I have a full memory dump of the process and when I do a post mortem debug
in windbg I get the following dissassembly where the access violation
occurred, in function postamble.
10074c02 8b4c2428 mov ecx,dword ptr [esp+28h]
10074c06 5f pop edi
10074c07 5e pop esi <-- access violation in this instruction.
10074c08 64890d00000000 mov dword ptr fs:[0],ecx
10074c0f 83c42c add esp,2Ch
10074c12 c20800 ret 8
So the access violation occurred when executing the pop esi instruction. Now
what I can't work out is why a pop esi instruction would cause an access
violation. The stack poiner is ok and pointing to valid memory, the stack
frames look ok and I can get a good stack dump with symbol files loaded in
the debugger.
My understanding of pop esi is that it should pop a 32 bit value off the
stack and place into esi. So the only memory access would be at esp, the
stack pointer. Is this correct?
The only other point is that perhaps the access violation occured in another
instruction around the pop esi and the address reported in the dump is not
correct.
Anyway I'm stumped so any help would be appreciated. I want to resolve the
issue of how a pop esi instruction causes an access violation.
My gut feeling is that I have some stack corruption going on.
Regards,
paul-shed
I have rather a nasty problem with my code which occasionally generates an
access violation when reading from memory. The address of the access
violation is not 0, it's different every time, but the address is outside of
the process memory space. So clearly there is a problem.
I have a full memory dump of the process and when I do a post mortem debug
in windbg I get the following dissassembly where the access violation
occurred, in function postamble.
10074c02 8b4c2428 mov ecx,dword ptr [esp+28h]
10074c06 5f pop edi
10074c07 5e pop esi <-- access violation in this instruction.
10074c08 64890d00000000 mov dword ptr fs:[0],ecx
10074c0f 83c42c add esp,2Ch
10074c12 c20800 ret 8
So the access violation occurred when executing the pop esi instruction. Now
what I can't work out is why a pop esi instruction would cause an access
violation. The stack poiner is ok and pointing to valid memory, the stack
frames look ok and I can get a good stack dump with symbol files loaded in
the debugger.
My understanding of pop esi is that it should pop a 32 bit value off the
stack and place into esi. So the only memory access would be at esp, the
stack pointer. Is this correct?
The only other point is that perhaps the access violation occured in another
instruction around the pop esi and the address reported in the dump is not
correct.
Anyway I'm stumped so any help would be appreciated. I want to resolve the
issue of how a pop esi instruction causes an access violation.
My gut feeling is that I have some stack corruption going on.
Regards,
paul-shed