JDK-7090904 : JSR 292: JRuby junit test crashes in PSScavengeRootsClosure::do_oop
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs22
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-09-15
  • Updated: 2012-03-22
  • Resolved: 2012-01-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u4Fixed 8Fixed hs23Fixed
Related Reports
Relates :  
Description
It's reproducible on linux-x64 with:

$ cd jruby
$ ant clean jar compile-test run-junit-precompiled

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f7d654fd378, pid=23769, tid=140175328392976
#
# JRE version: 7.0_02-b07
# Java VM: Java HotSpot(TM) 64-Bit Server VM (22.0-b04 mixed mode linux-amd64 )
# Problematic frame:
# V  [libjvm.so+0x74d378]  PSScavengeRootsClosure::do_oop(oopDesc**)+0x28
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#


Stack: [0x00007f7d1c97b000,0x00007f7d1ca7c000],  sp=0x00007f7d1ca7a790,  free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x74d378]  PSScavengeRootsClosure::do_oop(oopDesc**)+0x28
V  [libjvm.so+0x44cfa9]  frame::oops_interpreted_do(OopClosure*, RegisterMap const*, bool)+0xc9
V  [libjvm.so+0x800eba]  JavaThread::oops_do(OopClosure*, CodeBlobClosure*)+0x15a
V  [libjvm.so+0x74d5f5]  ThreadRootsTask::do_it(GCTaskManager*, unsigned int)+0x75
V  [libjvm.so+0x47ad30]  GCTaskThread::run()+0xf0
V  [libjvm.so+0x6edf80]  java_start(Thread*)+0x100

JavaThread 0x00007f7d6000a000 (nid = 23773) was being processed
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  java.lang.invoke.MethodHandleImpl$GuardWithCatch.invoke_L5(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+14
j  java.lang.invoke.MethodHandleImpl$GuardWithCatch.invoke_L5(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+11
v  ~RichochetBlob
j  java.lang.invoke.MethodHandle.invokeWithArguments([Ljava/lang/Object;)Ljava/lang/Object;+57
j  org.jruby.runtime.invokedynamic.InvocationLinker.invocationFallback(Lorg/jruby/runtime/invokedynamic/JRubyCallSite;Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Ljava/lang/String;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+185
j  $_dot_.test.testLoops.__file__(L$_dot_/test/testLoops;Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+845
j  $_dot_.test.testLoops.load(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Z)Lorg/jruby/runtime/builtin/IRubyObject;+17
<snip>

Comments
EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/b20d64f83668
22-03-2012

EVALUATION See main CR
30-11-2011

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-emb/hotspot/rev/b20d64f83668
29-11-2011

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/b20d64f83668
15-11-2011

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/b20d64f83668
24-10-2011

EVALUATION Adding an assert into AbstractInterpreter::layout_activation and running on Linux with: $ JAVA_OPTS="-d64 -server -XX:-PrintVMOptions -XX:+DeoptimizeALot" ant run-junit-precompiled results in: [junit] # Internal Error (/home/ct232829/hsx/hotspot-comp/7090904/src/cpu/x86/vm/templateInterpreter_x86_64.cpp:1626), pid=28522, tid=139933906372368 [junit] # assert(locals < caller->fp() + frame::interpreter_frame_initial_sp_offset) failed: bad placement for a couple of JRuby tests e.g.: testJRUBY3155.rb testLoops.rb testVisibility.rb testYAML.rb test_block.rb test_caller.rb test_crazy_blocks.rb test_methods.rb test_random.rb test_proc_visibility.rb test_require_once.rb test_super_call_site_caching.rb test_thread.rb test_threaded_nonlocal_return.rb
17-10-2011

EVALUATION Running with +VerifyBeforeGC results in: [junit] junit.framework.TestListener: startTest(testLoops.rb) [junit] VerifyBeforeGC:[Verifying threads # [junit] # A fatal error has been detected by the Java Runtime Environment: [junit] # [junit] # Internal Error (genOopClosures.hpp:178), pid=22395, tid=140629082933008 [junit] # guarantee(obj->is_oop_or_null()) failed: invalid oop: 0x0000000000000001
15-09-2011

EVALUATION I could only reproduce the crash on linux-x64. It happens with and without compressed oops, both UseSerialGC and UseParallelGC, and 7-b147 and latest 7u2-b07. UseSerialGC: Stack: [0x00007fd0a56f6000,0x00007fd0a57f7000], sp=0x00007fd0a57f4f10, free space=1019k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x3e4b74] FastScanClosure::do_oop(oopDesc**)+0x24 V [libjvm.so+0x44cfa9] frame::oops_interpreted_do(OopClosure*, RegisterMap const*, bool)+0xc9 V [libjvm.so+0x800eba] JavaThread::oops_do(OopClosure*, CodeBlobClosure*)+0x15a V [libjvm.so+0x7fd4b2] Threads::oops_do(OopClosure*, CodeBlobClosure*)+0x32 V [libjvm.so+0x7732c3] SharedHeap::process_strong_roots(bool, bool, SharedHeap::ScanningOption, OopClosure*, CodeBlobClosure*, OopsInGenClosure*)+0x1a3 V [libjvm.so+0x4836c4] GenCollectedHeap::gen_process_strong_roots(int, bool, bool, bool, SharedHeap::ScanningOption, OopsInGenClosure*, bool, OopsInGenClosure*)+0x74 V [libjvm.so+0x3e5f29] DefNewGeneration::collect(bool, bool, unsigned long, bool)+0x289 V [libjvm.so+0x485c62] GenCollectedHeap::do_collection(bool, bool, unsigned long, bool, int)+0x672 V [libjvm.so+0x37c20e] GenCollectorPolicy::satisfy_failed_allocation(unsigned long, bool)+0xce V [libjvm.so+0x843964] VM_GenCollectForAllocation::doit()+0x94 V [libjvm.so+0x849c2c] VM_Operation::evaluate()+0x4c V [libjvm.so+0x848710] VMThread::evaluate_operation(VM_Operation*)+0x80 V [libjvm.so+0x848c51] VMThread::loop()+0x1a1 V [libjvm.so+0x8492d0] VMThread::run()+0x70 V [libjvm.so+0x6edf80] java_start(Thread*)+0x100 UseParallelGC: Stack: [0x00007ff2b5c26000,0x00007ff2b5d27000], sp=0x00007ff2b5d25710, free space=1021k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x74d378] PSScavengeRootsClosure::do_oop(oopDesc**)+0x28 V [libjvm.so+0x44cfa9] frame::oops_interpreted_do(OopClosure*, RegisterMap const*, bool)+0xc9 V [libjvm.so+0x800eba] JavaThread::oops_do(OopClosure*, CodeBlobClosure*)+0x15a V [libjvm.so+0x74d5f5] ThreadRootsTask::do_it(GCTaskManager*, unsigned int)+0x75 V [libjvm.so+0x47ad30] GCTaskThread::run()+0xf0 V [libjvm.so+0x6edf80] java_start(Thread*)+0x100
15-09-2011