[Mono-bugs] [Bug 66915][Maj] New - Calling back on a delegate passed to native code through p/invoke on a different thread causes a crash.
Mon, 27 Sep 2004 13:35:46 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by email@example.com.
--- shadow/66915 2004-09-27 13:35:46.000000000 -0400
+++ shadow/66915.tmp.23909 2004-09-27 13:35:46.000000000 -0400
@@ -0,0 +1,38 @@
+Product: Mono: Runtime
+OS Details: SuSE 9.1 Pro
+Summary: Calling back on a delegate passed to native code through p/invoke on a different thread causes a crash.
+Description of Problem:
+I've attached a sample application that demonstrates the problem. Here is a
+summary of what happens:
+1. Managed code uses DllImport to get access to a native function that
+takes a function pointer as a parameter.
+2. Managed code creates delegate to pass into native function.
+3. Managed delegate is marshalled as a native function pointer.
+4. Native code stores function pointer and fires up a new thread to
+complete some operation asynchronously.
+5. When the operation is complete the native code calls back on the
+function pointer to indicate that the operation is complete.
+6. Mono runtime blows up with the following error message:
+** ERROR **: file mini.c: line 6552 (mono_get_lmf_addr): should not be reached
+Similar code run under .NET on windows does not have a problem.