[Mono-bugs] [Bug 77638][Nor] Changed - thread attaching for native->unmanaged wrappers

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Mar 2 05:54:48 EST 2006

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 lupus at ximian.com.


--- shadow/77638	2006-03-01 15:48:08.000000000 -0500
+++ shadow/77638.tmp.26712	2006-03-02 05:54:48.000000000 -0500
@@ -10,13 +10,13 @@
 Component: interop
 AssignedTo: lupus at ximian.com                            
 ReportedBy: nolan at thewordnerd.info               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
-Summary: [PPC] ** ERROR **: file mini.c: line 7646 (mono_get_lmf_addr): should not be reached
+Summary: thread attaching for native->unmanaged wrappers
 Description of Problem:
 I receive the following error when running the attached test code under OS X:
 ** ERROR **: file mini.c: line 7646 (mono_get_lmf_addr): should not be reached
@@ -52,6 +52,20 @@
 ------- Additional Comments From vargaz at gmail.com  2006-03-01 15:48 -------
 That would call thread_attach () for each native->managed call. The
 proper solution is to check the LMF TLS entry, and only call 
 thread_attach () if it is zero, as it is done on x86.
+------- Additional Comments From lupus at ximian.com  2006-03-02 05:54 -------
+Kangaroo: please commit, but without the lmf_pthread_key == -1 check.
+This should be unconditional.
+The x86 code is wrong in this regard. The reason is that
+mono_thread_attach() may also change the current domain for the thread
+(I'll fix the runtime code to actually do this).
+This is needed when a callback is registered by multiple appdomains:
+we want the domain to be set correctly when they are called.
+I don't think the native-to-managed transitions are so performance
+sensitive, but in case, not only the lmf_addr need to be checked for
+NULL, but also the domain tls needs to be compared for equality with
+the one we're going to set.
+Please let's leave this bug open when all the architectures are fixed.

More information about the mono-bugs mailing list