Closed jkuipers closed 9 months ago
I suspect this is a dup of https://github.com/eclipse-openj9/openj9/issues/18750, which has already been fixed for the next release.
Does it work with one of these pre-release builds for the next release?
Thanks for the fast response! Sorry for missing that issue, looks like I only searched in the open issues before filing this one. I just downloaded the pre-release build and can confirm that it fixes the problem. Great to see that this will be in the next release, really looking forward to adopting the OpenJ9 Java 21 implementation!
Actually I'll keep this open for a while to make it easier for others to find.
Thanks, can confirm the fix works for me, too.
Semeru 21.0.2 is published so I'll close this now.
Java -version output
openjdk version "21.0.1" 2023-10-17 LTS IBM Semeru Runtime Open Edition 21.0.1.0 (build 21.0.1+12-LTS) Eclipse OpenJ9 VM 21.0.1.0 (build openj9-0.42.0, JRE 21 Windows 11 amd64-64-Bit Compressed References 20231017_78 (JIT enabled, AOT enabled) OpenJ9 - 874af12ee OMR - 11700e64f JCL - cb91cd755e3 based on jdk-21.0.1+12)
Note that the problem can also be reproduced on Ubuntu, you don't need to run this on Windows.
Summary of problem
When using Mockito to mock a class, the JVM crashes with a Segmentation error. This is related to Mockito's use of the ByteBuddy java agent. When you mock an interface, which doesn't require ByteBuddy, the problem does not occur.
Diagnostic files
Even though I have these files, the problem is trivial to reproduce so I'm rather attaching a demo to do that. segmentationerror.zip
Run the sample with Maven like this:
mvn compile exec:java -Dexec.mainClass=SegmentationErrorDemo