Boehm - linuxthreads bug

The old linuxthreads implementation has a problem with the way the Boehm GC stops all threads running and the way our signal handler thread works.

This problem does not exist with NPTL. Use it where you can!

If you have to stick with linuxthreads, use this patch:

Index: src/vm/vm.c
===================================================================
--- src/vm/vm.c (revision 7675)
+++ src/vm/vm.c (working copy)
@@ -1592,8 +1592,10 @@ bool vm_create(JavaVMInitArgs *vm_args)
 
        /* start the signal handler thread */
 
+#if 0
        if (!signal_start_thread())
                vm_abort("vm_create: signal_start_thread failed");
+#endif
 
        /* finally, start the finalizer thread */
 
Index: src/vm/signal.c
===================================================================
--- src/vm/signal.c     (revision 7675)
+++ src/vm/signal.c     (working copy)
@@ -89,6 +89,7 @@ void signal_init(void)
 
        (void) memory_mmap_anon(NULL, pagesize, PROT_NONE, MAP_PRIVATE | MAP_FIXED);
 
+#if 0
        /* Block the following signals (SIGINT for <ctrl>-c, SIGQUIT for
           <ctrl>-\).  We enable them later in signal_thread, but only for
           this thread. */
@@ -106,6 +107,7 @@ void signal_init(void)
 
        if (sigprocmask(SIG_BLOCK, &mask, NULL) != 0)
                vm_abort("signal_init: sigprocmask failed: %s", strerror(errno));
+#endif
 
 #if defined(ENABLE_GC_BOEHM)
        /* Allocate something so the garbage collector's signal handlers

cacaowiki: BoehmLinuxthreadsBug (last edited 2007-04-06 15:27:20 by ChristianThalinger)