United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7108383 JSR 292: JRuby bench_define_method_methods.rb: assert(slow_jvms != NULL) failed: miss path must not
JDK-7108383 : JSR 292: JRuby bench_define_method_methods.rb: assert(slow_jvms != NULL) failed: miss path must not

Details
Type:
Bug
Submit Date:
2011-11-04
Status:
Closed
Updated Date:
2012-03-22
Project Name:
JDK
Resolved Date:
2012-01-20
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs23
Fixed Versions:
hs23 (b08)

Related Reports
Backport:
Backport:

Sub Tasks

Description
$ jruby -X+C -J-d32 --server -J-Xbatch bench/bench_define_method_methods.rb                                                                  user     system      total        real
control, simple method, 10k * 100 invocations                 1.106000   0.000000   1.106000 (  0.734000)
define_method(:foo) {1}, 10k * 100 invocations                2.174000   0.000000   2.174000 (  2.174000)
eval'ed define_method(:baz) {1}, 10k * 100 invocations        7.032000   0.000000   7.032000 (  7.033000)
define_method(:bar) {a = 1}, 10k * 100 invocations            1.225000   0.000000   1.225000 (  1.225000)
b = 1; define_method(:baz) {b = 2}, 10k * 100 invocations     1.166000   0.000000   1.166000 (  1.166000)
                                                                  user     system      total        real
control, simple method, 10k * 100 invocations                 2.255000   0.000000   2.255000 (  2.255000)
define_method(:foo) {1}, 10k * 100 invocations              # To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/callGenerator.cpp:822
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/ct232829/hsx/hotspot-comp/hotspot/src/share/vm/opto/callGenerator.cpp:822), pid=10484, tid=3456101232
#  assert(slow_jvms != NULL) failed: miss path must not fail to generate
#
# JRE version: 8.0-b11
# Java VM: Java HotSpot(TM) Server VM (23.0-b03-internal-jvmg mixed mode linux-x86 )
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /export/twisti/jruby/hs_err_pid10484.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#

                                    

Comments
EVALUATION

(dbx) where
current thread: t@21
  [1] _waitid(0x0, 0x67b1, 0xd636fd60, 0x3), at 0xfeecaf95 
  [2] _waitpid(0x67b1, 0xd636fe24, 0x0), at 0xfee793bf 
  [3] waitpid(0x67b1, 0xd636fe24, 0x0), at 0xfeebc805 
=>[4] os::fork_and_exec(cmd = 0xfed53abc "dbx - 26474"), line 6287 in "os_solaris.cpp"
  [5] VMError::show_message_box(this = 0xd63700c4, buf = 0xfed53abc "dbx - 26474", buflen = 2000), line 56 in "vmError_solaris.cpp"
  [6] VMError::report_and_die(this = 0xd63700c4), line 811 in "vmError.cpp"
  [7] report_vm_error(file = 0xfe781733 "/home/ct232829/hsx/hotspot-comp/hotspot/src/share/vm/opto/callGenerator.cpp", line = 822, error_msg = 0xfe78177f "assert(slow_jvms != NULL) failed", detail_msg = 0xfe7817a0 "miss path must not fail to generate"), line 220 in "debug.cpp"
  [8] PredictedDynamicCallGenerator::generate(this = 0x94f8e68, jvms = 0x984bc28), line 822 in "callGenerator.cpp"
  [9] Parse::do_call(this = 0xd6370af4), line 469 in "doCall.cpp"
  [10] Parse::do_one_bytecode(this = 0xd6370af4), line 2220 in "parse2.cpp"
  [11] Parse::do_one_block(this = 0xd6370af4), line 1405 in "parse1.cpp"
  [12] Parse::do_all_blocks(this = 0xd6370af4), line 680 in "parse1.cpp"
  [13] Parse::Parse(this = 0xd6370af4, caller = 0x984ae10, parse_method = 0xa200720, expected_uses = 11264.0), line 589 in "parse1.cpp"
  [14] ParseGenerator::generate(this = 0x94f8c40, jvms = 0x984ae10), line 85 in "callGenerator.cpp"
  [15] Parse::do_call(this = 0xd637142c), line 469 in "doCall.cpp"
  [16] Parse::do_one_bytecode(this = 0xd637142c), line 2220 in "parse2.cpp"
  [17] Parse::do_one_block(this = 0xd637142c), line 1405 in "parse1.cpp"
  [18] Parse::do_all_blocks(this = 0xd637142c), line 680 in "parse1.cpp"
  [19] Parse::Parse(this = 0xd637142c, caller = 0x8ce4428, parse_method = 0xa1fe2b8, expected_uses = 11264.0), line 589 in "parse1.cpp"
  [20] ParseGenerator::generate(this = 0x94f88c0, jvms = 0x8ce4428), line 85 in "callGenerator.cpp"
  [21] Parse::do_call(this = 0xd6371d64), line 469 in "doCall.cpp"
  [22] Parse::do_one_bytecode(this = 0xd6371d64), line 2220 in "parse2.cpp"
  [23] Parse::do_one_block(this = 0xd6371d64), line 1405 in "parse1.cpp"
  [24] Parse::do_all_blocks(this = 0xd6371d64), line 680 in "parse1.cpp"
  [25] Parse::Parse(this = 0xd6371d64, caller = 0x836d890, parse_method = 0xac42a50, expected_uses = 2.0), line 589 in "parse1.cpp"
  [26] ParseGenerator::generate(this = 0xac5dd30, jvms = 0x836d890), line 85 in "callGenerator.cpp"
  [27] Compile::Compile(this = 0xd6372508, ci_env = 0xd6372b28, compiler = 0x8313d68, target = 0xac42a50, osr_bci = 35, subsume_loads = true, do_escape_analysis = true), line 685 in "compile.cpp"
  [28] C2Compiler::compile_method(this = 0x8313d68, env = 0xd6372b28, target = 0xac42a50, entry_bci = 35), line 130 in "c2compiler.cpp"
  [29] CompileBroker::invoke_compiler_on_method(task = 0x836d3b0), line 1710 in "compileBroker.cpp"
  [30] CompileBroker::compiler_thread_loop(), line 1551 in "compileBroker.cpp"
  [31] compiler_thread_entry(thread = 0x831c800, __the_thread__ = 0x831c800), line 3005 in "thread.cpp"
  [32] JavaThread::thread_main_inner(this = 0x831c800), line 1537 in "thread.cpp"
  [33] JavaThread::run(this = 0x831c800), line 1517 in "thread.cpp"
  [34] java_start(thread_addr = 0x831c800), line 1072 in "os_solaris.cpp"
  [35] _thr_setup(0xfd779a00), at 0xfeec71d0 
  [36] _lwp_start(0x0, 0x67b1, 0xd636fd60, 0x3, 0xfd779a00, 0xfef3e000), at 0xfeec74c0 
(dbx) fr 8
Current function is PredictedDynamicCallGenerator::generate
  822         assert(slow_jvms != NULL, "miss path must not fail to generate");
(dbx) dump
pjvms = CLASS
log = (nil)
kit = CLASS
iophi = 0xac4e854
bol = 0x96ec2b8
slow_ctl = 0x96ec3c8
limit = 180676692U
this = 0x94f8e68
slow_jvms = (nil)
slow_map = (nil)
bc = 183
tos = 137814720U
predicted_mh = 0x982abac
jvms = 0x984bc28
predicted_mh_ptr = 0x9ed586c
iff = 0x96ec30c
new_jvms = 0xfdf68dde
region = (nil)
gvn = CLASS
                                     
2011-11-04
SUGGESTED FIX

Removing the assert and returning on failed slow path generations results in:

                                  @ 3   org.jruby.runtime.invokedynamic.InvocationLinker::testMetaclass (17 bytes)   NodeCountInliningCutoff
                                @ 16   java.lang.invoke.MethodHandle::invokeExact (10 bytes)   inline (hot)
                                @ 35   java.lang.invoke.MethodHandle::invokeExact (56 bytes)   inline (hot)
                                @ 35   java.lang.invoke.MethodHandle::invokeExact (11 bytes)   inline (hot)
                                  @ 7   org.jruby.runtime.invokedynamic.InvocationLinker::invocationFallback (104 bytes)   method handle not reached
   4   COMPILE SKIPPED: out of nodes parsing method (not retryable)

and the test finishes successful.
                                     
2011-11-09
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/a04a201f0f5a
                                     
2011-11-17
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-emb/hotspot/rev/a04a201f0f5a
                                     
2011-12-15
EVALUATION

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

The problem is that the code in PredictedDynamicCallGenerator::generate assumes that the generation of the slow path always succeeds.  This might not be the case when we hit the node limit while generating the slow path.
                                     
2011-11-09



Hardware and Software, Engineered to Work Together