winapi - Interpreting App Verifier output: Heap corruption or misinterpreting stack address as heap address? -


we have test case crashes our big mfc-based app heap corruption error.

i turned on page heap using app verifier dll in question (turning heap on entire process isn't workable other reasons, unfortunately.) verifier didn't give more information had; triggered @ same point original crash.

right have 2 competing theories. theory think more correct, , next steps be?

  1. this indeed heap corruption. verifier isn't catching original damage because it's happening in dll. should try activate verifier more dlls , determine code damaging heap.
  2. the heap fine; problem treating stack address heap address. should study code in callstack further figure out what's going wrong.

i'm leaning #2 because parameter free() looks stack address, far nobody has proposed explanation how possible.

here's snippet of call stack. mystring simple wrapper around cstring. myappdll dll that's set use page heap.

msvcr90.dll!free(void * pblock=0x000000000012d6e8)  line 110 mfc90u.dll!atl::cstringt > >::~cstringt > >()  line 1011 + 0x1e bytes mystringdll.dll!mystring::~mystring()  line 59 myappdll.dll!dostuffwithlotsofstringinlining(myclass* input=0x000000000012d6d0)  line 863 + 0x26 bytes

here registers inside free() stack frame:

 rax = 0000000000000000 rbx = 000000000012d6e8 rcx = 0000000000000000  rdx = 0000000000000000 rsi = 000000000012d6d0 rdi = 00000000253c1090  r8  = 0000000000000000 r9  = 0000000000000000 r10 = 0000000000000000  r11 = 0000000000000000 r12 = 000000000012d7d0 r13 = 000007ffffc04ce0  r14 = 0000000025196600 r15 = 0000000000000000 rip = 00000000725bc7bc  rsp = 000000000012d570 rbp = 000007fff3670900 efl = 00000000  

and here's app verifier message:

 verifier stop 0000000000000010: pid 0x1778: corrupted start stamp heap block.       00000000083b1000 : heap handle used in call.     000000006dd394e8 : heap block involved in operation.     54d32858a8747589 : size of heap block.     000000005e33ba8d : corrupted stamp value. 

i think string or users of is/are overflowing/underflowing string's buffer somewhere, against field next string pointer, try free.

your rsp 12d570, 94 quads (ints) away trying free, somewhere between there, bad happening buffers.

verify not doing unsafe string ops , correctly reading documentation passing buffers/strings dlls using.

you need more code in question if want more exact answer.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -