BZ #191: Intermittent shutdown failures

Status fields:

creation_ts:2014-01-08 21:27
component:threads
version:default branch
rep_platform:All
op_sys:All
bug_status:RESOLVED
resolution:FIXED
reporter:stefan@complang.tuwien.ac.at
The buildbot test runs – interestingly (almost) only on i386 – occasionally fail like
this:

LOG: [0x563eeb70] Mutex::lock(): pthread_mutex_lock failed: Invalid argument
LOG: [0x563eeb70] Backtrace (14 stack frames):
LOG: [0x563eeb70] ../../../src/cacao/.libs/libjvm.so(_ZN2os15print_backtraceEv+0x3b)
[0x558b746b]
LOG: [0x563eeb70] ../../../src/cacao/.libs/libjvm.so(+0x81561) [0x558b7561]
LOG: [0x563eeb70] ../../../src/cacao/.libs/libjvm.so(+0x814f7) [0x558b74f7]
LOG: [0x563eeb70] ../../../src/cacao/.libs/libjvm.so(_ZN10ThreadList14release_threadEP12
threadobjectb+0x3f) [0x55898b8f]
LOG: [0x563eeb70] ../../../src/cacao/.libs/libjvm.so(+0x63eb6) [0x55899eb6]
LOG: [0x563eeb70] ../../../src/cacao/.libs/libjvm.so(+0x78148) [0x558ae148]
LOG: [0x563eeb70] ../../../src/cacao/.libs/libjvm.so(GC_invoke_finalizers+0xc5)
[0x55874995]
LOG: [0x563eeb70] ../../../src/cacao/.libs/libjvm.so(+0x77c49) [0x558adc49]
LOG: [0x563eeb70] ../../../src/cacao/.libs/libjvm.so(+0x653af) [0x5589b3af]
LOG: [0x563eeb70] ../../../src/cacao/.libs/libjvm.so(GC_inner_start_routine+0x6e)
[0x5588123e]
LOG: [0x563eeb70] ../../../src/cacao/.libs/libjvm.so(GC_call_with_stack_base+0x2a)
[0x5587c11a]
LOG: [0x563eeb70] ../../../src/cacao/.libs/libjvm.so(GC_start_routine+0x28) [0x55882b28]

Exhibit 1: http://c1.complang.tuwien.ac.at:8010/builders/cacao-classpath-i386-clang-
fast/builds/444

The problem is that the threadlist lock is being removed by a global destructor while
still in use.

Comment #1 by stefan@complang.tuwien.ac.at on 2015-01-15 22:52:13

Seems to be eliminated for classpath builds, but running the bugzilla regression tests
with OpenJDK still results in:

#0  0x00000033004328a5 in raise () from /lib64/libc.so.6
#1  0x0000003300434085 in abort () from /lib64/libc.so.6
#2  0x00007f43f97ff199 in os::abort () at ../../src/vm/os.hpp:199
#3  0x00007f43f9824068 in abort_verrnum(int, const char *, typedef __va_list_tag
__va_list_tag *) (errnum=22,
    text=0x7f43f989f3d8 "Mutex::lock(): pthread_mutex_lock failed", ap=0x7f43f0696b40)
at os.cpp:126
#4  0x00007f43f9824173 in os::abort_errnum (errnum=22, text=0x7f43f989f3d8
"Mutex::lock(): pthread_mutex_lock failed")
    at os.cpp:155
#5  0x00007f43f97c49c7 in Mutex::lock (this=0x7f43f9b12560) at ../../src/threads/posix
/mutex-posix.hpp:116
#6  0x00007f43f97f9ab2 in AnyObjLocker<Mutex>::AnyObjLocker (this=0x7f43f0696c90,
mutex=...)
    at ../../src/threads/mutex.hpp:48
#7  0x00007f43f981244b in Finalizer::reinstall_custom_finalizer (h=0x1bd6690) at
finalizer.cpp:341
#8  0x00007f43f98120b6 in finalizer_run (o=0x1bd6690, p=0x0) at finalizer.cpp:265
#9  0x00007f43f97cb536 in GC_invoke_finalizers () at finalize.c:814
#10 0x00007f43f97c67aa in gc_invoke_finalizers () at gc-boehm.cpp:209
#11 0x00007f43f9811fdc in finalizer_thread () at finalizer.cpp:169
#12 0x00007f43f97fc246 in threads_startup_thread (arg=0x7fffba163e60) at thread-
posix.cpp:712
#13 0x00007f43f97d80bf in GC_inner_start_routine (sb=<value optimized out>, arg=<value
optimized out>)
    at pthread_start.c:56
#14 0x00007f43f97d29da in GC_call_with_stack_base (fn=<value optimized out>, arg=<value
optimized out>) at misc.c:1553
#15 0x0000003300c07851 in start_thread () from /lib64/libpthread.so.0

Comment #2 by stefan@complang.tuwien.ac.at on 2015-01-20 20:34:36

I don't know of any outstanding issues with this one.