Page 1 of 1

Did madExcept cause this exception?

Posted: Wed Jul 25, 2018 5:58 am
by lizhengdao
It's quite strange that the except thread is madExcept itself.
What can I do to avoid this from happening?

Code: Select all

exception number   : 1
exception class    : EAccessViolation
exception message  : Access violation at address 753DA078 in module 'msvcrt.dll'. Read of address 12AA6000.

thread $22c4:
753da078 +04a msvcrt.dll
753da006 +1ac msvcrt.dll             memmove
004a90a9 +00d MPTool.exe   madExcept CallThreadProcSafe
004a910e +032 MPTool.exe   madExcept ThreadExceptFrame
76d8343b +010 kernel32.dll           BaseThreadInitThunk
>> created by thread $198c at:
753e139c +06e msvcrt.dll             _beginthreadex

Re: Did madExcept cause this exception?

Posted: Wed Jul 25, 2018 6:47 am
by madshi
It's not strange at all. madExcept will be listed as part of every thread callstack. The reason for that is that madExcept has to hook itself into every thread, to be able to catch and report the exceptions properly. This is not (at all) an indication that madExcept would be causing the exception.

Re: Did madExcept cause this exception?

Posted: Thu May 20, 2021 9:17 pm
by wpostma
What would cause Madexcepts' line 17490 to raise at the cmp ebx, esp?

Code: Select all

  function CallThreadProcSafe(threadProc, param: pointer) : dword; stdcall;
  // protect the stack, just in case the thread function is incorrect
  asm
    push ebx
    mov ebx, esp
    mov eax, [ebp+$c]
    push eax
    mov eax, [ebp+$8]
    call eax
    // if everything is alright, we should have "esp = ebp" here
    cmp ebx, esp   ; <-- access violation raises here!



Re: Did madExcept cause this exception?

Posted: Thu May 20, 2021 9:32 pm
by madshi
Could be a thread function which has an incorrect calling convention, or an incorrect number of parameters, maybe? Or a thread function which has somehow overwritten its own stack (e.g. due to a buffer overrun on a local variable).