ManualResetEvent.WaitOne throws System.AccessViolationException

  • Thread starter Thread starter Critter79606
  • Start date Start date
C

Critter79606

Guest
We have a multi-threaded application that receives events from a device that unlocks a worker thread.

When we receive an event, EventWaitHandle.Set() is called to unlock the worker thread and then goes back to waiting for other hardware events.

Before the WaitOne can return in the worker thread the following error is recorded in the dump file.

System.AccessViolationException Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


I can not figure out why this is happening. Thread 26 comes from a 3rd party library, and is back waiting by the time the crash occurs.

This is a mixed native/.Net 4.6 C++ app. I'd be thankful for any help.


Thread 49 is waiting, thread 26 is setting the event and then going back to sleep.

In exe.5788.dmp the Module C:\Windows\System32\KERNELBASE.dll has caused an access violation exception (0xC0000005) when trying to execute instructions from a non-executable address at memory location 0x00000000 on thread 49

Thread 49 - System ID 2628
Entry point clr!Thread::intermediateThreadProc
Create time 10/31/2018 12:07:21 PM
Time spent in user mode 0 Days 00:00:00.015
Time spent in kernel mode 0 Days 00:00:00.015


This thread is not fully resolved and may or may not be a problem. Further analysis of these threads may be required.

The thread has evidence of .net exceptions on the stack. Check the Previous .NET Exceptions Report (Exceptions in all .NET Thread Stacks) to view more details of the associated exception
.NET Call Stack

[[GCFrame]]
[[DebuggerU2MCatchHandlerFrame]]

Full Call Stack
ntdll!NtWaitForMultipleObjects+c
KERNELBASE!WaitForMultipleObjectsEx+cc
kernel32!WaitForMultipleObjects+19
kernel32!WerpReportFaultInternal+50b
kernel32!WerpReportFault+74
KERNELBASE!UnhandledExceptionFilter+1f4
ntdll!__RtlUserThreadStart+54554
[[GCFrame]]
[[DebuggerU2MCatchHandlerFrame]]
ntdll!_RtlUserThreadStart+1b


Thread 26 - System ID 5008
Entry point msvcr80!_threadstart
Create time 10/31/2018 12:07:16 PM
Time spent in user mode 0 Days 00:00:00.000
Time spent in kernel mode 0 Days 00:00:00.000


This thread is waiting in a WaitOne
.NET Call Stack
[[HelperMethodFrame_1OBJ] (System.Threading.WaitHandle.WaitOneNative)] System.Threading.WaitHandle.WaitOneNative(System.Runtime.InteropServices.SafeHandle, UInt32, Boolean, Boolean)
mscorlib_ni!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle, Int64, Boolean, Boolean)+21
mscorlib_ni!System.Threading.WaitHandle.WaitOne(Int32, Boolean)+28
mscorlib_ni!System.Threading.WaitHandle.WaitOne()+12
ACIDialogic.Dialogic.ccHandler()+897
.ACIDialogic.cc_handler(UInt32)+6

Full Call Stack
ntdll!NtWaitForMultipleObjects+c
KERNELBASE!WaitForMultipleObjectsEx+cc
clr!WaitForMultipleObjectsEx_SO_TOLERANT+3c
clr!Thread::DoAppropriateWaitWorker+237
clr!Thread::DoAppropriateWait+64
clr!WaitHandleNative::CorWaitOneNative+163
[[HelperMethodFrame_1OBJ] (System.Threading.WaitHandle.WaitOneNative)] System.Threading.WaitHandle.WaitOneNative(System.Runtime.InteropServices.SafeHandle, UInt32, Boolean, Boolean)
mscorlib_ni!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle, Int64, Boolean, Boolean)+21
mscorlib_ni!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle, Int64, Boolean, Boolean)+21
mscorlib_ni!System.Threading.WaitHandle.WaitOne(Int32, Boolean)+28
mscorlib_ni!System.Threading.WaitHandle.WaitOne(Int32, Boolean)+28
mscorlib_ni!System.Threading.WaitHandle.WaitOne()+12
mscorlib_ni!System.Threading.WaitHandle.WaitOne()+12
ACIDialogic.Dialogic.ccHandler()+897
librtfmt!RtfRegisterClient+692
<Module>.ACIDialogic.cc_handler(UInt32)+6
clr!IJWNOADThunkJumpTarget+15
libsrlmt!sr_relseall+2b2
libsrlmt!sr_waitevt+15f
libsrlmt!sr_enbhiprihdlr+107
msvcr80!_callthreadstart+1b
msvcr80!_threadstart+5a
ntdll!__RtlUserThreadStart+2f
ntdll!_RtlUserThreadStart+1b

Continue reading...
 
Back
Top