Bugzilla – Bug 318378
[PATCH] TLS issues
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by robertj@gmx.net 2005-06-27 08:43:54 MST ---- [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. ---- Additional Comments From robertj@gmx.net 2005-06-27 08:44:32 MST ---- Created an attachment (id=168186) tls.diff ---- Additional Comments From robertj@gmx.net 2005-06-27 08:45:16 MST ---- Created an attachment (id=168187) test case ---- Additional Comments From miguel@ximian.com 2005-06-29 19:46:28 MST ---- Paolo, can you review/comment on this one? ---- Additional Comments From lupus@ximian.com 2005-07-07 06:18:12 MST ---- This is fixed in svn. Robert: you might want to report to the libc folks to check if this is also a bug in the dl support. Imported an attachment (id=168186) Imported an attachment (id=168187) Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>SUSE 9.0-9.3</cf_op_sys_details> Unknown operating system SUSE 9.2. Setting to default OS "Other".