Hi!

As I mentioned before, I'm seeing deadlocks with GcTortureTest when
"-Xgc" is enabled. I've been debugging the problem for a bit now and I
think it's a generic problem of entering the GC from within a JIT
trampoline while we're holding cu->mutex. See the below backtrace for
details (I think Thread 2 is coming from a trampoline although the
backtrace is truncated).

I'm not sure what's the cleanest way to fix this. Sure, we could try to
shuffle some code around to drop the trampoline mutex before entering
the GC but that just seems too fragile to live with. One alternative
solution would be to disallow calling gc_alloc() from VM code paths and
use plain old malloc() instead.

Tomek, Vegard, thoughts?

                        Pekka

penb...@penberg-laptop:~/src/jato$ gdb --args ./jato -Xgc -cp regression 
jvm/GcTortureTest
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) handle SIGSEGV nostop
Signal        Stop      Print   Pass to program Description
SIGSEGV       No        Yes     Yes             Segmentation fault
(gdb) r
Starting program: /home/penberg/src/jato/jato -Xgc -cp regression 
jvm/GcTortureTest
[Thread debugging using libthread_db enabled]
[New Thread 0xb7437f00 (LWP 25736)]

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.

Program received signal SIGSEGV, Segmentation fault.
[New Thread 0xa7335b90 (LWP 25739)]
[New Thread 0xa6b34b90 (LWP 25740)]

Program received signal SIGSEGV, Segmentation fault.
[New Thread 0xa6333b90 (LWP 25741)]

Program received signal SIGSEGV, Segmentation fault.
^C
Program received signal SIGINT, Interrupt.
[Switching to Thread 0xb7437f00 (LWP 25736)]
0xb7795424 in __kernel_vsyscall ()
(gdb) thread apply all backtrace

Thread 4 (Thread 0xa6333b90 (LWP 25741)):
#0  0xb7795424 in __kernel_vsyscall ()
#1  0xb7768cf9 in __lll_lock_wait () at 
../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/lowlevellock.S:136
#2  0xb7764129 in _L_lock_89 () from /lib/tls/i686/cmov/libpthread.so.0
#3  0xb7763a32 in __pthread_mutex_lock (mutex=0x8f0a95c) at 
pthread_mutex_lock.c:86
#4  0x08078e60 in jit_magic_trampoline (cu=0x8f0a8f0) at jit/trampoline.c:125
#5  0xa743681d in ?? ()
#6  0x080565d5 in native_call_eax (method=0x8f08a70, target=0xa7436810, 
args=0xa632eac0, result=0xa632ea70) at arch/x86/call.c:43
#7  0x080566ce in native_call (method=0x8f08a70, target=0xa7436810, 
args=0xa632eac0, result=0xa632eb4c) at arch/x86/call.c:146
#8  0x080813f7 in call_method_a (method=0x8f08a70, target=0xa7436810, 
args=0xa632eac0, result=0xa632eb4c) at vm/call.c:54
#9  0x0808154d in vm_call_method_v (method=0x8f08a70, args=0xa632eb68 "", 
result=0xa632eb4c) at vm/call.c:69
#10 0x08093849 in vm_call_method (method=0x8f08a70) at include/vm/call.h:60
#11 0x0809389d in vm_thread_entry (arg=0xc85d660) at vm/thread.c:254
#12 0xb77624ff in start_thread (arg=0xa6333b90) at pthread_create.c:297
#13 0xb751d49e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 3 (Thread 0xa6b34b90 (LWP 25740)):
#0  0xb7795424 in __kernel_vsyscall ()
#1  0xb7768cf9 in __lll_lock_wait () at 
../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/lowlevellock.S:136
#2  0xb7764129 in _L_lock_89 () from /lib/tls/i686/cmov/libpthread.so.0
#3  0xb7763a32 in __pthread_mutex_lock (mutex=0x8f0a95c) at 
pthread_mutex_lock.c:86
#4  0x08078e60 in jit_magic_trampoline (cu=0x8f0a8f0) at jit/trampoline.c:125
#5  0xa743681d in ?? ()
#6  0x080565d5 in native_call_eax (method=0x8f08a70, target=0xa7436810, 
args=0xa6b2fac0, result=0xa6b2fa70) at arch/x86/call.c:43
#7  0x080566ce in native_call (method=0x8f08a70, target=0xa7436810, 
args=0xa6b2fac0, result=0xa6b2fb4c) at arch/x86/call.c:146
#8  0x080813f7 in call_method_a (method=0x8f08a70, target=0xa7436810, 
args=0xa6b2fac0, result=0xa6b2fb4c) at vm/call.c:54
#9  0x0808154d in vm_call_method_v (method=0x8f08a70, args=0xa6b2fb68 "", 
result=0xa6b2fb4c) at vm/call.c:69
#10 0x08093849 in vm_call_method (method=0x8f08a70) at include/vm/call.h:60
#11 0x0809389d in vm_thread_entry (arg=0xc856cd8) at vm/thread.c:254
#12 0xb77624ff in start_thread (arg=0xa6b34b90) at pthread_create.c:297
#13 0xb751d49e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 2 (Thread 0xa7335b90 (LWP 25739)):
#0  0xb7795424 in __kernel_vsyscall ()
#1  0xb77660e5 in pthread_cond_wait@@GLIBC_2.3.2 () from 
/lib/tls/i686/cmov/libpthread.so.0
#2  0x08086808 in gc_start (regs=0xa733041c) at vm/gc.c:137
#3  0x080868ae in gc_alloc (size=128) at vm/gc.c:163
#4  0x08090291 in vm_object_alloc (class=0x8db3df0) at vm/object.c:50
#5  0x08082fcc in vm_class_ensure_object (vmc=0x8eece00) at vm/class.c:593
#6  0x0807e42c in native_vmclassloader_loadclass (name=0xc85dbb8, resolve=0 
'\0') at runtime/classloader.c:91
#7  0xa74e01a3 in ?? ()
#8  0x00000000 in ?? ()

Thread 1 (Thread 0xb7437f00 (LWP 25736)):
#0  0xb7795424 in __kernel_vsyscall ()
#1  0xb77660e5 in pthread_cond_wait@@GLIBC_2.3.2 () from 
/lib/tls/i686/cmov/libpthread.so.0
#2  0x080866de in do_gc_safepoint () at vm/gc.c:84
#3  0x08086743 in gc_safepoint (regs=0xb74336d8) at vm/gc.c:94
#4  0x080918a9 in gc_safepoint_bh (addr=2806908387) at vm/signal.c:81
#5  0x0806989a in signal_bh_trampoline () at arch/x86/signal-bh.S:28
#6  0xa74e05e3 in ?? ()
#7  0xb7597ff4 in ?? () from /lib/tls/i686/cmov/libc.so.6
#8  0x08089956 in main (argc=5, argv=0xbfba2af4) at vm/jato.c:1055
(gdb) 



------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to