Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Molaro <lupus@oddwiz.org>2006-02-28 19:15:15 +0300
committerPaolo Molaro <lupus@oddwiz.org>2006-02-28 19:15:15 +0300
commit993711711521930e3fd6c65ced4581a7afa2ddcb (patch)
treea84312a3254462f0ec5c218c2c588d645b4ef7e3
parent4ba996de383616d4f699ab6df1854ded5c656e11 (diff)
Backported "init running on non-main thread" fix.
svn path=/branches/mono-1-1-13/mono/; revision=57398
-rw-r--r--configure.in2
-rw-r--r--mono/mini/ChangeLog6
-rw-r--r--mono/mini/mini.c22
3 files changed, 29 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index 112c92e87cd..a34bdccf898 100644
--- a/configure.in
+++ b/configure.in
@@ -926,6 +926,8 @@ if test x$platform_win32 = xno; then
AC_DEFINE(USE_MONO_MUTEX)
])
AC_CHECK_FUNCS(pthread_attr_setstacksize)
+ AC_CHECK_FUNCS(pthread_attr_getstack)
+ AC_CHECK_FUNCS(pthread_get_stacksize_np pthread_get_stackaddr_np)
dnl ***********************************
dnl *** Checks for working __thread ***
diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog
index d1170114ef0..993898702d1 100644
--- a/mono/mini/ChangeLog
+++ b/mono/mini/ChangeLog
@@ -30,6 +30,12 @@ Wed Feb 22 20:21:47 CET 2006 Paolo Molaro <lupus@ximian.com>
* debug-debugger.h: Add missing file, copied verbatim from
trunk (r56444).
+Wed Feb 8 19:33:17 CET 2006 Paolo Molaro <lupus@ximian.com>
+
+ * mini.c: always handle the case when mono_jit_init()
+ is called in a thread different from the main thread,
+ confusing libgc (bug #77309).
+
Mon Feb 6 09:01:24 EST 2006 Paolo Molaro <lupus@ximian.com>
* mini-ppc.c: fix handling of exceptions in large methods (bug #74932).
diff --git a/mono/mini/mini.c b/mono/mini/mini.c
index 3d2f3c00531..90a1882e5b2 100644
--- a/mono/mini/mini.c
+++ b/mono/mini/mini.c
@@ -10281,12 +10281,32 @@ mini_init (const char *filename)
if (getenv ("MONO_DEBUG") != NULL)
mini_parse_debug_options ();
- if (mono_running_on_valgrind ()) {
+ /* we used to do this only when running on valgrind,
+ * but it happens also in other setups.
+ */
+#if defined(HAVE_BOEHM_GC)
+#if defined(HAVE_PTHREAD_GETATTR_NP) && defined(HAVE_PTHREAD_ATTR_GETSTACK)
+ {
+ size_t size;
+ void *sstart;
+ pthread_attr_t attr;
+ pthread_getattr_np (pthread_self (), &attr);
+ pthread_attr_getstack (&attr, &sstart, &size);
+ /*g_print ("stackbottom pth is: %p\n", (char*)sstart + size);*/
+ GC_stackbottom = (char*)sstart + size;
+ }
+#elif defined(HAVE_PTHREAD_GET_STACKSIZE_NP) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
+ GC_stackbottom = (char*)pthread_get_stackaddr_np (pthread_self ());
+#else
+ {
gsize stack_bottom = (gsize)&domain;
stack_bottom += 4095;
stack_bottom &= ~4095;
+ /*g_print ("stackbottom is: %p\n", (char*)stack_bottom);*/
GC_stackbottom = (char*)stack_bottom;
}
+#endif
+#endif
MONO_GC_PRE_INIT ();
mono_jit_tls_id = TlsAlloc ();