JDK-7030715 : JSR 292 JRuby test/test_super_call_site_caching.rb asserts with +DoEscapeAnalysis
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs21
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-03-24
  • Updated: 2011-07-29
  • Resolved: 2011-05-10
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 Other
7Fixed hs21Fixed
Description
Running JRuby's test/test_super_call_site_caching.rb with JDK 7 b134 fastdebug on solaris-i586 results in:

$ bin/jruby.sh --server -Xcompile.invokedynamic=true -J-Xbatch -J-XX:+ShowMessageBoxOnError -J-XX:+UseSerialGC -J-XX:+UnlockExperimentalVMOptions -J-XX:+EnableMethodHandles -J-XX:+EnableInvokeDynamic test/test_super_call_site_caching.rb
VM option '+ShowMessageBoxOnError'
VM option '+UseSerialGC'
VM option '+UnlockExperimentalVMOptions'
VM option '+EnableMethodHandles'
VM option '+EnableInvokeDynamic'
Loaded suite test/test_super_call_site_caching
Started
..# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/ciMethod.hpp:108
==============================================================================
Unexpected Error
------------------------------------------------------------------------------
Internal Error at ciMethod.hpp:108, pid=19761, tid=7
assert(is_loaded()) failed: not loaded: invokeExact

Do you want to debug the problem?

To debug, run 'dbx - 19761'; then switch to thread 7
Enter 'yes' to launch dbx automatically (PATH must include dbx)
Otherwise, press RETURN to abort...
==============================================================================


(dbx) where
current thread: t@7
  [1] _waitid(0x0, 0x4d4f, 0xd573a6d0, 0x3), at 0xfeecaf95 
  [2] _waitpid(0x4d4f, 0xd573a798, 0x0), at 0xfee793bf 
  [3] waitpid(0x4d4f, 0xd573a798, 0x0), at 0xfeebc805 
=>[4] os::fork_and_exec(cmd = 0xfec43510 "dbx - 19761"), line 6244 in "os_solaris.cpp"
  [5] VMError::show_message_box(this = 0xd573aa38, buf = 0xfec43510 "dbx - 19761", buflen = 2000), line 56 in "vmError_solaris.cpp"
  [6] VMError::report_and_die(this = 0xd573aa38), line 806 in "vmError.cpp"
  [7] report_vm_error(file = 0xfe5ebe7b "/home/ct232829/hotspot-comp/hotspot/src/share/vm/ci/ciMethod.hpp", line = 108, error_msg = 0xfe5ebebc "assert(is_loaded()) failed", detail_msg = 0xd573aaac "not loaded: invokeExact"), line 216 in "debug.cpp"
  [8] ciMethod::check_is_loaded(this = 0x89c01b8), line 108 in "ciMethod.hpp"
  [9] ciMethod::flags(this = 0x89c01b8), line 122 in "ciMethod.hpp"
  [10] ciMethod::is_static(this = 0x89c01b8), line 251 in "ciMethod.hpp"
  [11] BCEscapeAnalyzer::invoke(this = 0x8ed0040, state = CLASS, code = _invokedynamic, target = 0x89c01b8, holder = 0x8933328), line 237 in "bcEscapeAnalyzer.cpp"
  [12] BCEscapeAnalyzer::iterate_one_block(this = 0x8ed0040, blk = 0x8717460, state = CLASS, successors = CLASS), line 862 in "bcEscapeAnalyzer.cpp"
  [13] BCEscapeAnalyzer::iterate_blocks(this = 0x8ed0040, arena = 0xd573da58), line 1099 in "bcEscapeAnalyzer.cpp"
  [14] BCEscapeAnalyzer::do_analysis(this = 0x8ed0040), line 1135 in "bcEscapeAnalyzer.cpp"
  [15] BCEscapeAnalyzer::compute_escape_info(this = 0x8ed0040), line 1291 in "bcEscapeAnalyzer.cpp"
  [16] BCEscapeAnalyzer::BCEscapeAnalyzer(this = 0x8ed0040, method = 0x89bfa60, parent = (nil)), line 1422 in "bcEscapeAnalyzer.cpp"
  [17] ciMethod::get_bcea(this = 0x89bfa60), line 1127 in "ciMethod.cpp"
  [18] ConnectionGraph::process_call_result(this = 0x88f9ee0, resproj = 0x8f95e20, phase = 0xd573c95c), line 2136 in "escape.cpp"
  [19] ConnectionGraph::record_for_escape_analysis(this = 0x88f9ee0, n = 0x8f95e20, phase = 0xd573c95c), line 2393 in "escape.cpp"
  [20] ConnectionGraph::compute_escape(this = 0x88f9ee0), line 1536 in "escape.cpp"
  [21] ConnectionGraph::do_analysis(C = 0xd573d444, igvn = 0xd573c95c), line 1504 in "escape.cpp"
  [22] Compile::Optimize(this = 0xd573d444), line 1660 in "compile.cpp"
  [23] Compile::Compile(this = 0xd573d444, ci_env = 0xd573da50, compiler = 0x8243d70, target = 0x8e10550, osr_bci = -1, subsume_loads = true, do_escape_analysis = true), line 733 in "compile.cpp"
  [24] C2Compiler::compile_method(this = 0x8243d70, env = 0xd573da50, target = 0x8e10550, entry_bci = -1), line 130 in "c2compiler.cpp"
  [25] CompileBroker::invoke_compiler_on_method(task = 0x87b5c80), line 1573 in "compileBroker.cpp"
  [26] CompileBroker::compiler_thread_loop(), line 1414 in "compileBroker.cpp"
  [27] compiler_thread_entry(thread = 0x8258800, __the_thread__ = 0x8258800), line 2913 in "thread.cpp"
  [28] JavaThread::thread_main_inner(this = 0x8258800), line 1503 in "thread.cpp"
  [29] JavaThread::run(this = 0x8258800), line 1487 in "thread.cpp"
  [30] java_start(thread_addr = 0x8258800), line 1067 in "os_solaris.cpp"
  [31] _thr_setup(0xfd772a00), at 0xfeec71d0 
  [32] _lwp_start(0x0, 0x4d4f, 0xd573a6d0, 0x3, 0xfd772a00, 0xfef3e000), at 0xfeec74c0

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/548597e74aa4
05-05-2011

EVALUATION 7030715: JSR 292 JRuby test/test_super_call_site_caching.rb asserts with +DoEscapeAnalysis Reviewed-by: twisti is_static shouldn't be called on unloaded ciMethods. Instead of just adjusting the assert I decided to move the proper logic into ciMethod and modify the regular arg_size routine to complain if it's called on unloaded methods since it may return the wrong answer in that case. Tested with failing test and with CTW to ensure that the new assert doesn't trigger for other code.
26-04-2011

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/548597e74aa4
26-04-2011

WORK AROUND Using -Xverify:all passes the test (with and without DoEscapeAnalysis).
31-03-2011

EVALUATION (dbx) p this->print() <ciMethod name=invokeExact holder=java/dyn/MethodHandle signature=(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Ljava/lang/String;)Lorg/jruby/runtime/builtin/IRubyObject; loaded=false ident=920 address=0x86bf870>this->print() = (void) (dbx) p *this *this = { _flags = { _flags = 0 } _name = 0x80b3ad0 _holder = 0x80b8170 _signature = 0x86bf8d8 _method_data = (nil) _method_blocks = (nil) _code_size = -1414812757 _max_stack = -1414812757 _max_locals = -1414812757 _intrinsic_id = _none _handler_count = -1414812757 _interpreter_invocation_count = -1414812757 _interpreter_throwout_count = -1414812757 _uses_monitors = true _balanced_monitors = true _is_c1_compilable = true _is_c2_compilable = true _can_be_statically_bound = false _code = 0xabababab "<bad address 0xabababab>" _exception_handlers = 0xabababab _liveness = (nil) _flow = (nil) _bcea = (nil) }
28-03-2011

EVALUATION For some indexes the CallSite object (stored in f1 in the secondary constant pool cache entry) is not initialized yet when the compiler kicks in. The logic in ciEnv::get_fake_invokedynamic_method_impl then returns an unloaded method in this case resulting in the assert in escape analysis code.
28-03-2011