Re: Hard crash in JVM

Remi Forax <[email protected]> Sat, 3 Sep 2016 13:33:45 +0200 (CEST)
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
> De: "Alexander Kampmann" <[email protected]>
> À: [email protected]
> Envoyé: Vendredi 2 Septembre 2016 19:12:10
> Objet: [asm] Hard crash in JVM

> hey,

hi Alex, 

> I have a problem with an instrumentation. When I run instrumented code, the JVM
> says:
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> # Internal Error (javaCalls.cpp:53), pid=7268, tid=139709765379840
> # guarantee(!thread->is_Compiler_thread()) failed: cannot make java calls from
> the compiler
> #
> # JRE version: OpenJDK Runtime Environment (8.0_91-b14) (build
> 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
> # Java VM: OpenJDK 64-Bit Server VM (25.91-b14 mixed mode linux-amd64 compressed
> oops)
> # 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:
> # /home/campino/tests/output/hs_err_pid7268.log
> [thread 139709766432512 also had an error]
> #
> # Compiler replay data is saved as:
> # /home/campino/tests/output/replay_pid7268.log
> #
> # If you would like to submit a bug report, please visit:
> # http://bugreport.java.com/bugreport/crash.jsp
> #

> If I interpret this error correctly, I somehow got the JVM to execute Java Code
> on the JIT-Thread.

yes, it seems so :( 

> Do you have any ideas what could cause this, how I could debug this or what else
> to do about it?

Fecilitation, you have crashed the VM, you're grown up now :) 
First, you should report the issue with a minimum test case. 

> The instrumentation is not that complicated. I just need to do a method call
> before IF_ICMPEQ instructions.

Do you use java.lang.instrument and change classes from the bootclasspath, classes like java.lang.Object, etc ? 
Because, in that case, the bytecode of these classes is not verified. 

To be sure that you are not generating something stupid, ASM provides the CheckClassAdapter that does some extensive checks, 
it may help you. 

> This method call needs the two inputs to the comparison as arguments, so I am
> doing some magic with DUP/DUP_X in order to re-arrange
> the arguments on the stack as needed. If I, instead of using DUP/DUP_X2 etc.
> just place constants there and do my method call, it works as expected.

Did you special case for long and double, these guys takes two slots ? 

> Thanks for your help,
> Alex

regards, 
Rémi 

> --
> You receive this message as a subscriber of the [email protected] mailing list.
> To unsubscribe: mailto:[email protected]
> For general help: mailto:[email protected]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws


-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws