Re: RTLFreeHeap bug

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



A couple of things:

1. It doesn't make sense to continue execution after a pageheap
break. The state of the process is already corrupt at this point so
you should grab the very first break or exception that you get
under windbg and try to debug it. Look at the stack trace and
try to understand where the address in question came from.
Doing !heap -p -a <address> might be helpful.

2. If possible, try to reproduce the problem under full pageheap.
Add as much RAM as you can. If you are running out of pagefile
space (check in task manager if that's the case), increase your
pagefile. If you are running out of virtual address space (VM Usage
in task manager or Process\Virtual Bytes in perfmon is close to
2 GB), try using /3GB in boot.ini and link your app with
/largeaddressaware (though this might bring its own problems).

--
This posting is provided "AS IS" with no warranties, and confers no
rights.

"dianthos" wrote:

> Oleg thanks for your hints!
>
> What I did was use gflags with full traces and simple traces (gflags /p
> /enable myapp.exe /full and gflags /p /enable myapp.exe)
> I then started my apllication in both the Visual Studio debugger and
> WinDbg. The application was crashing, as you can see in the following
> traces, and then I was continuing execution.
> With full traces the application was consuming huge amounds of memory
>>200 MB while loading my corrupted documents. After 3-4 minutes I was
>>stopping the debugger while my application hadn't manage to load my
>>documents.
> With simple traces the aplication was crashing again but continuing the
> execution maged to load the my documents. Exactly as without any page
> heap checks (disabled)
>
> Here are the traces from the two debugers (only the intresting(?)
> parts)
> **************************************************************************
>>Full Traces WinDbg<
>
> (6a4.6b4): Access violation - code c0000005 (first chance)
> First chance exceptions are reported before any exception handling.
> This exception may be expected and handled.
> eax=0010a8ac ebx=01b7f000 ecx=01b83000 edx=01b83008 esi=01b7efe0
> edi=02271000
> eip=77fb4481 esp=0010a848 ebp=0010a880 iopl=0 nv up ei ng nz ac
> pe cy
> cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000
> efl=00010293
> ntdll!RtlpDphIsNormalHeapBlock+0x86:
> 77fb4481 8039a0 cmp byte ptr [ecx],0xa0
> ds:0023:01b83000=??
> *** WARNING: Unable to verify checksum for I:\Source\bin\PRKMGR.dll
> *** ERROR: Symbol file could not be found. Defaulted to export symbols
> for I:\Source\bin\PRKMGR.dll -
> 0:000> g


.



Relevant Pages