[Mono-bugs] [Bug 75390][Wis] New - [PATCH] TLS issues

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Jun 27 08:43:55 EDT 2005


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 robertj at gmx.net.

http://bugzilla.ximian.com/show_bug.cgi?id=75390

--- shadow/75390	2005-06-27 08:43:55.000000000 -0400
+++ shadow/75390.tmp.19525	2005-06-27 08:43:55.000000000 -0400
@@ -0,0 +1,56 @@
+Bug#: 75390
+Product: Mono: Runtime
+Version: 1.1
+OS: SUSE 9.2
+OS Details: SUSE 9.0-9.3
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: GC
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: robertj at gmx.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PATCH] TLS issues
+
+[Rephrased from the mail "[PATCH] issue with libmono.so and dlopen"
+@ mono-devel-list. Sorry for that]
+
+Description:
+
+If mono is built using the "--with-tls=__thread" option,
+the one and only libgc variable declared with __thread
+will cause dlopen(3) problems because its declaration doesn't
+specify a compatible TLS model.
+
+The default TLS model for unattributed __thread declarations
+is "global-dynamic" which doesn't seem to be compatible with
+dlopen(3).
+
+See test case.
+
+Affected systems I tested with:
+SUSE 9.0-9.3
+
+Patch:
+
+libmono uses  __attribute__((tls_model("local-exec"))) for
+__thread variables, so I just added the same code block I
+found in utils/mono-compiler.h to libgc/pthread_support.c
+
+The patch will probably speed-up the GC a little bit, although
+I did't profile it.
+
+Suggestions:
+
+I'm not happy with the attached patch because it duplicates
+code between libmono and libgc, so I'd provide another patch,
+if you guys would accept this solution:
+
+configure.is probes whether the GCC switch -ftls-model
+is working. If yes, -ftls-model=local-exec will be added
+to the CFLAGS of libmono and libgc. MONO_FAST_TLS might be
+obsoleted.


More information about the mono-bugs mailing list