Re: Access violation bug in XP but not 2K
- From: "Ivan Brugiolo [MSFT]" <Ivan.Brugiolo@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 3 Oct 2006 12:05:56 -0700
On top of suggestions form others related with the toolset used to generate
the application,
I would investigate the route of reuse-after-delete.
In the stack below, your `esi` register contains feeefeee, that is a fill
pattern for deleted heap allocations.
I'm not familiar with the MFC code, but, I would suspect that your
application is forcing MFC to access the thread-local-storage data
after the libraries has free-ed that memory.
You could enable full-page-heap
(gflags.exe -p /enable YourOwnTestExecutable.exe /full)
and try to repro under debugger.
On average you would issue a `!heap -p -a <address>`
with the address of your crash.
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<Paulaner> wrote in message
news:5ij3i2lv9gned2kfol18htqi98scurspiu@xxxxxxxxxx
I have a nasty little 'access violation' bug in a big old VC6 (plus
other languages) application that may take a while to find. It has
been in the code for a while, but only recently its become a real
nuisance for users and needs to get fixed.
The problem only happens on Windows XP when the app is built in
release mode. It does not happen in W2K, and it does not happen in XP
when I build with debug. I assume XP has better memory management,
and this is why we see it now whereas we didn't see it in NT or 2K.
I'm disappointed the debug code can't tell me what variable/code
really triggered the access violation.
I've tried using WinDbg.exe "Microsoft Debugging Tools for Windows" to
see the problem, but I'm at a loss on how to track the issue back to
source code. I've added the Microsoft symbol files
(SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols) and all
the .SYM files from the app but I cannot tell where this error is
coming from.
Any suggestions?
Debugger window:
(7c4.158c): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=00234d60 ebx=00000001 ecx=00000002 edx=00000001 esi=feeefeee
edi=001c335c
eip=73dd1024 esp=0012e664 ebp=0012e688 iopl=0 nv up ei ng nz
na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000
efl=00010282
MFC42!CThreadLocalObject::GetData+0x51:
73dd1024 8b34b0 mov esi,dword ptr [eax+esi*4]
ds:0023:fbdf4918=????????
Stack trace:
73dd60ae 73dd4a95 00000001 MFC42!CThreadLocalObject::GetData+0x51
00000001 0012e6f8 73e63eaa MFC42!AfxGetModuleThreadState+0x16
00000001 0044675d 00000000 MFC42!afxMapHMENU+0x10
00000000 0012e6d8 0012e6e4 MFC42!CMenu::FromHandle+0x7
WARNING: Stack unwind information not available. Following frames may
be wrong.
0012e734 77c37a86 0012e748 image00400000+0x4675d
0012e734 77c37a86 0012e748 image00400000+0x4675d
00000000 00000000 00242710 msvcrt!_cinit+0x91
00000000 0012e748 0012e754 msvcrt!_cexit+0xd
77c10000 00000000 00000001 msvcrt!_CRTDLL_INIT+0x12d
77c1e94f 77c10000 00000000 ntdll!LdrpCallInitRoutine+0x14
0012fd38 00000000 000604b0 ntdll!LdrShutdownProcess+0x149
00000064 77e8f3b0 ffffffff kernel32!_ExitProcess+0x37
00000064 0012ea84 003c603b kernel32!TerminateProcess
...
The next reference is to a source code line in a thread that reads
exit(1).
.
- Prev by Date: Re: Set registry value with environment string on x64
- Next by Date: Re: Change of behavoir between windows 2000 and windows 2003 and Low Fragmentation Heap for the Process Heap
- Previous by thread: RE: Access violation bug in XP but not 2K
- Next by thread: GINA: NT Group Policy not applied
- Index(es):
Relevant Pages
|