Appverif checks

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Gisle Vanem
Posts: 34
Joined: Mon May 04, 2015 10:30 am

Appverif checks

Post by Gisle Vanem »

I'm using the Everthing SDK in my program envtool.
Now I've added some appverif.exe tests for my program
that shows some misuse (?) of the Process Heap by everything.c.
First here are my appverif.exe settings:
Image

And here's the call-stack on the AppVerif check:

Code: Select all

vrfcore!VerifierStopMessageEx+0x7f7
vrfcore!VfCoreRedirectedStopMessage+0x87
verifier!VerifierStopMessage+0xb9
verifier!AVrfpDphReportCorruptedBlock+0x2c7
verifier!AVrfpDphCheckPageHeapBlock+0x16c
verifier!AVrfpDphFindBusyMemory+0xca
verifier!VerifierCheckPageHeapAllocation+0x46
vfbasics!AVrfpHeapFree+0x72
envtool!_Everything_Free+0x1f
envtool!_Everything_SendIPCQuery2+0x1d7
envtool!_Everything_SendIPCQuery+0x44
envtool!_Everything_query_thread_proc+0x17a
vfbasics!AVrfpStandardThreadFunction+0x4e
KERNEL32!BaseThreadInitThunk+0x14
ntdll!RtlUserThreadStart+0x21
From !analyze -v in WinDbg:

Code: Select all

APPLICATION_VERIFIER_HEAPS_CORRUPTED_HEAP_BLOCK_SUFFIX (f)
Corrupted suffix pattern for heap block.
Most typically this happens for buffer overrun errors. Sometimes the application
verifier places non-accessible pages at the end of the allocation and buffer
overruns will cause an access violation and sometimes the heap block is
followed by a magic pattern. If this pattern is changed when the block gets
freed you will get this break. These breaks can be quite difficult to debug
because you do not have the actual moment when corruption happened.
You just have access to the free moment (stop happened here) and the
allocation stack trace (!heap -p -a HEAP_BLOCK_ADDRESS) 
Arguments:
Arg1: 000001738e851000, Heap handle used in the call. 
Arg2: 00000173a2ecdfd0, Heap block involved in the operation. 
Arg3: 000000000000002f, Size of the heap block. 
Arg4: 00000173a2ecdfff, Corruption address. 
Any ideas?
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: Appverif checks

Post by void »

Please make sure you are using the correct Everything_SetSearchW or Everything_SetSearchA call.

Please make sure you are passing a wchar string to Everything_SetSearchW (or an ANSI string to Everything_SetSearchA)
Please make sure these strings are NULL terminated.

Does the issue persist?
Gisle Vanem
Posts: 34
Joined: Mon May 04, 2015 10:30 am

Re: Appverif checks

Post by Gisle Vanem »

> Does the issue persist?

Yes. I think it's a double-free. Since if I disable the line:

Code: Select all

 // get result from window.
 //  _Everything_Free(query);
in the bottom of _Everything_SendIPCQuery2(), there is no bug-check.

And I've modified AppVerif to look for leaks; there are not any.
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: Appverif checks

Post by void »

Could you please try the latest SDK

There was a recent fix that would cause this crash.
Does the issue persists with the latest SDK dlls?



The crash you are seeing is most likely caused by heap corruption.
_Everything_Free will call HeapFree, which will perform a heap check.



The Everything SDK uses HeapAlloc/HeapFree, which will likely not show any leaks, even when there are leaks.
Replace HeapAlloc/HeapFree with malloc/free to be sure.
Gisle Vanem
Posts: 34
Joined: Mon May 04, 2015 10:30 am

Re: Appverif checks

Post by Gisle Vanem »

> Does the issue persists with the latest SDK dlls?

No! That fixed it. Thanks.
Post Reply