[MVT] hotspot crash

Tobias Hartmann tobias.hartmann at oracle.com
Tue Sep 19 15:04:21 UTC 2017


Hi Remi,

thanks for reporting this crash!

With a debug build, this fails with an assert [1] suggesting that we failed to resolve a class. It turns out we are 
about to create c2i and i2c adapters for the method 'plus' from 'fr/umlv/valuetypify/test/InternalTest' but fail because 
the class 'fr/umlv/valuetypify/test/InternalTest$Int$Value' is not found.

Running with -XX:-ValueTypePassFieldsAsArgs -noverify correctly fails with a NoClassDefFoundError:
  Exception in thread "main" java.lang.NoClassDefFoundError: fr/umlv/valuetypify/test/InternalTest$Int$Value
	at fr.umlv.valuetypify.test.InternalTest.main(InternalTest.java:33)

You are right that we should not crash in this case. I filed:
https://bugs.openjdk.java.net/browse/JDK-8187679

Running with the verifier enabled fails with [2]. I guess this is a problem with your bytecode generation.

Thanks,
Tobias

[1]
#  Internal Error (/oracle/valhalla/hotspot/src/share/vm/runtime/sharedRuntime.cpp:2733), pid=31260, tid=31264
#  assert(k != __null && !(((ThreadShadow*)__the_thread__)->has_pending_exception())) failed: can resolve klass?

[2]
Exception in thread "main" java.lang.VerifyError: Bad local variable type
Exception Details:
   Location:
 
fr/umlv/valuetypify/test/InternalTest$Int.add(Qfr/umlv/valuetypify/test/InternalTest$Int$Value;)Qfr/umlv/valuetypify/test/InternalTest$Int$Value; 
@4: vload
   Reason:
     Type 'fr/umlv/valuetypify/test/InternalTest$Int' (current frame, locals[0]) is not assignable to value type
   Current Frame:
     bci: @4
     flags: { }
     locals: { 'fr/umlv/valuetypify/test/InternalTest$Int', 'fr/umlv/valuetypify/test/InternalTest$Int$Value' }
     stack: { uninitialized 0, uninitialized 0 }
   Bytecode:
     0000000: bb00 0359 cb00 b400 2fcb 01b4 002f 60b7
     0000010: 0004 d300 2ecf

	at fr.umlv.valuetypify.test.InternalTest.main(InternalTest.java:33)


On 15.09.2017 22:33, Remi Forax wrote:
> oops,
> i'm doing some modifications to my bytecode rewriter, so the generated code has a good chance to be generate an invalid class, but the VM should not crash.
> 
> To reproduce download the jar here:
>    http://www-igm.univ-mlv.fr/~forax/tmp/mvt/
> 
> and run
>    java -XX:+EnableMVT -cp test-valuetypified.jar fr.umlv.valuetypify.test.InternalTest
> 
> cheers,
> Rémi
> 
> ---
> 
> ~/java/workspace/mvt/valhalla/build/linux-x86_64-normal-server-release/jdk/bin/java -XX:+EnableMVT -cp test-valuetypified.jar fr.umlv.valuetypify.test.InternalTest
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> #  SIGSEGV (0xb) at pc=0x00007f17dd170907, pid=17320, tid=17321
> #
> # JRE version: OpenJDK Runtime Environment (10.0) (build 10-internal+0-adhoc.forax.valhalla)
> # Java VM: OpenJDK 64-Bit Server VM (10-internal+0-adhoc.forax.valhalla, mixed mode, compressed oops, g1 gc, linux-amd64)
> # Problematic frame:
> # V  [libjvm.so+0xbd4907]  ValueKlass::adr_extended_sig() const [clone .constprop.129]+0x7
> #
> # Core dump will be written. Default location: Core dumps may be processed with "/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t %P %I" (or dumping to /home/forax/git/valuetypify/core.17320)
> #
> # An error report file with more information is saved as:
> # /home/forax/git/valuetypify/hs_err_pid17320.log
> #
> # If you would like to submit a bug report, please visit:
> #   http://bugreport.java.com/bugreport/crash.jsp
> #
> Aborted (core dumped)
> 


More information about the valhalla-dev mailing list