JDK-7032070 : JSR 292: JRuby test/test_thread.rb fails with: illegal bytecode sequence - method not verified
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs21
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2011-03-29
  • Updated: 2011-04-20
  • Resolved: 2011-04-20
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
7Resolved
Related Reports
Duplicate :  
Description
This assert sometimes triggers when running in a loop:

intelsdv01:/export/twisti/jruby$ bin/jruby.sh --server -Xcompile.invokedynamic=true -J-XX:-PrintVMOptions -J-XX:+UseSerialGC test/test_thread.rb
Loaded suite test/test_thread
Started
............=============== DEBUG MESSAGE: illegal bytecode sequence - method not verified ================

# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/assembler_x86.cpp:5093
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/ct232829/hotspot-comp/6817525/src/cpu/x86/vm/assembler_x86.cpp:5093), pid=16856, tid=1126
#  assert(false) failed: DEBUG MESSAGE
#
# JRE version: 7.0-b135
# Java VM: Java HotSpot(TM) Server VM (21.0-b05-internal-fastdebug mixed mode solaris-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_pid16856.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Current thread is 1126
Dumping core ...
Abort
---------------  T H R E A D  ---------------

Current thread (0x08f02400):  JavaThread "RubyThread-1115: /export/twisti/jruby/lib/ruby/1.8/test/unit/testcase.rb:78" daemon [_thread_in_vm, id=1126, stack(0xd1eae000,0xd1fae000)]

Stack: [0xd1eae000,0xd1fae000],  sp=0xd1facd80,  free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1ce44f6]  void VMError::report(outputStream*)+0x902
V  [libjvm.so+0x1ce56a9]  void VMError::report_and_die()+0x56d
V  [libjvm.so+0xaf7b6a]  void report_vm_error(const char*,int,const char*,const char*)+0x53a
V  [libjvm.so+0x4f1ca4]  void MacroAssembler::debug32(int,int,int,int,int,int,int,int,int,char*)+0x40c
j  test.test_thread.method__37$RUBY$call_to_s(Ltest/test_thread;Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+10
j  test$test_thread#method__37$RUBY$call_to_s.call(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/RubyModule;Ljava/lang/String;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+19
j  test$test_thread#method__37$RUBY$call_to_s.call(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/RubyModule;Ljava/lang/String;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;+11
j  org.jruby.runtime.invokedynamic.InvokeDynamicSupport.fallback(Lorg/jruby/runtime/invokedynamic/InvokeDynamicSupport$JRubyCallSite;Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Ljava/lang/String;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;+79
j  test.test_thread.block_39$RUBY$test_poly_calls_thread_safe(Ltest/test_thread;Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+42
j  test$test_thread#block_39$RUBY$test_poly_calls_thread_safe.call(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+9
j  org.jruby.runtime.CompiledBlock.yield(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Binding;Lorg/jruby/runtime/Block$Type;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+49
j  org.jruby.runtime.CompiledBlock.yield(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Binding;Lorg/jruby/runtime/Block$Type;)Lorg/jruby/runtime/builtin/IRubyObject;+9
j  org.jruby.runtime.Block.yield(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;+14
j  org.jruby.RubyFixnum.times(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+49
j  org.jruby.RubyFixnum$i$0$0$times.call(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/RubyModule;Ljava/lang/String;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+7
j  org.jruby.runtime.invokedynamic.InvokeDynamicSupport.fallback(Lorg/jruby/runtime/invokedynamic/InvokeDynamicSupport$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;+88
j  test.test_thread.block_38$RUBY$test_poly_calls_thread_safe(Ltest/test_thread;Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+49
j  test$test_thread#block_38$RUBY$test_poly_calls_thread_safe.call(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+9
j  org.jruby.runtime.CompiledBlock.yield(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/RubyModule;ZLorg/jruby/runtime/Binding;Lorg/jruby/runtime/Block$Type;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+70
j  org.jruby.runtime.BlockBody.call(Lorg/jruby/runtime/ThreadContext;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Binding;Lorg/jruby/runtime/Block$Type;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+27
j  org.jruby.runtime.Block.call(Lorg/jruby/runtime/ThreadContext;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+15
j  org.jruby.RubyProc.call(Lorg/jruby/runtime/ThreadContext;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject;+59
j  org.jruby.RubyProc.call(Lorg/jruby/runtime/ThreadContext;[Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject;+7
j  org.jruby.internal.runtime.RubyRunnable.run()V+94
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub
V  [libjvm.so+0xf181f8]  void JavaCalls::call_helper(JavaValue*,methodHandle*,JavaCallArguments*,Thread*)+0x894
V  [libjvm.so+0x185033c]  void os::os_exception_wrapper(void(*)(JavaValue*,methodHandle*,JavaCallArguments*,Thread*),JavaValue*,methodHandle*,JavaCallArguments*,Thread*)+0x18
V  [libjvm.so+0xf15e90]  void JavaCalls::call_virtual(JavaValue*,Handle,KlassHandle,Symbol*,Symbol*,Thread*)+0x458
V  [libjvm.so+0x118f35e]  void thread_entry(JavaThread*,Thread*)+0x266
V  [libjvm.so+0x1bdc509]  void JavaThread::thread_main_inner()+0x179
V  [libjvm.so+0x1bdc1b9]  void JavaThread::run()+0x619
V  [libjvm.so+0x183feeb]  java_start+0x6fb
C  [libc.so.1+0xa71d0]  _thr_setup+0x4e
C  [libc.so.1+0xa74c0]  __moddi3+0x60

Comments
EVALUATION Using -Xverify:all doesn't make a difference.
18-04-2011

EVALUATION VerifyOops didn't find a problem.
18-04-2011

EVALUATION The bug also happens on SPARC and x86 Linux, so it's not architecture or OS specific but a more fundamental bug: terminus:/export/twisti/jruby$ while [ $? -eq 0 ]; do bin/jruby.sh --server -Xcompile.invokedynamic=true -J-showversion -J-XX:+ShowMessageBoxOnError -J-XX:-PrintVMOptions -J-XX:+UseSerialGC test/test_thread.rb; done ... java version "1.7.0-ea-fastdebug" Java(TM) SE Runtime Environment (build 1.7.0-ea-fastdebug-b137) Java HotSpot(TM) Server VM (build 21.0-b08-internal-fastdebug, mixed mode) Loaded suite test/test_thread Started ............EXECUTION STOPPED: illegal bytecode sequence - method not verified ============================================================================== illegal bytecode sequence - method not verified ------------------------------------------------------------------------------ Execution stopped, print registers? ==============================================================================
15-04-2011

EVALUATION Since it also happens with C1 and deoptimization disabled this is not a deopt problem (as I actually thought it is): intelsdv01:/export/twisti/jruby$ while [ $? -eq 0 ]; do bin/jruby.sh -J-XX:-DeoptC1 -Xcompile.invokedynamic=true -J-showversion -J-XX:+ShowMessageBoxOnError -J-XX:-PrintVMOptions -J-XX:+UseSerialGC test/test_thread.rb; done java version "1.7.0-ea-fastdebug" Java(TM) SE Runtime Environment (build 1.7.0-ea-fastdebug-b137) Java HotSpot(TM) Client VM (build 21.0-b08-internal-jvmg, mixed mode) Loaded suite test/test_thread Started ............============================================================================== illegal bytecode sequence - method not verified ------------------------------------------------------------------------------ Execution stopped, print registers? ==============================================================================
12-04-2011

EVALUATION ScavengeRootsInCode=2 also triggers the bug.
12-04-2011

EVALUATION It also reproduces on SPARC: terminus:/export/twisti/jruby$ while [ $? -eq 0 ]; do bin/jruby.sh --server -Xcompile.invokedynamic=true -J-showversion -J-XX:+ShowMessageBoxOnError -J-XX:-PrintVMOptions -J-XX:+UseSerialGC test/test_thread.rb; done java version "1.7.0-ea-fastdebug" Java(TM) SE Runtime Environment (build 1.7.0-ea-fastdebug-b137) Java HotSpot(TM) Server VM (build 21.0-b08-internal-fastdebug, mixed mode) Loaded suite test/test_thread Started ............EXECUTION STOPPED: illegal bytecode sequence - method not verified ============================================================================== illegal bytecode sequence - method not verified ------------------------------------------------------------------------------ Execution stopped, print registers? ==============================================================================
12-04-2011

EVALUATION This also happens with the client compiler: java version "1.7.0-ea-fastdebug" Java(TM) SE Runtime Environment (build 1.7.0-ea-fastdebug-b137) Java HotSpot(TM) Client VM (build 21.0-b07-fastdebug, mixed mode) Loaded suite test/test_thread Started ............============================================================================== illegal bytecode sequence - method not verified ------------------------------------------------------------------------------ Execution stopped, print registers? ==============================================================================
11-04-2011