-
Notifications
You must be signed in to change notification settings - Fork 248
Description
After switching to Mockito's inline MockMaker my integration tests are crashing when using JBR 17.0.14 build1367.22 with -XX:+AllowEnhancedClassRedefinition.
Running tests with an Oracle JDK is successful.
The underlying issue is that Mockito's inline Mock maker redefines "java.lang.Object". When I debug into the Mockito code and manually edit the set of redefined classes (by removing java.lang.Object) it works.
In #259 it is stated that redefining java.lang.Object should be possible now.
Note: Since these tests are integration tests running in an OSGI environment the classloading is pretty complex.
With JBR 17.0.12 test execution will just hang forever in "retransformClasses()". With 17.0.14 I'm getting the following access violation
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffc2d9442df, pid=16216, tid=27292
#
# JRE version: OpenJDK Runtime Environment JBR-17.0.14+1-1367.22-jcef (17.0.14+1) (build 17.0.14+1-b1367.22)
# Java VM: OpenJDK 64-Bit Server VM JBR-17.0.14+1-1367.22-jcef (17.0.14+1-b1367.22, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# V [jvm.dll+0x4d42df]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# https://youtrack.jetbrains.com/issues/JBR
--------------- S U M M A R Y ------------
Host: 12th Gen Intel(R) Core(TM) i7-1260P, 16 cores, 31G, Windows 11 , 64 bit Build 22621 (10.0.22621.4391)
Time: Tue Feb 11 13:57:09 2025 Mitteleuropäische Zeit elapsed time: 393.396099 seconds (0d 0h 6m 33s)
--------------- T H R E A D ---------------
Current thread (0x000001247fb34e00): VMThread "VM Thread" [stack: 0x0000002401100000,0x0000002401200000] [id=27292]
Stack: [0x0000002401100000,0x0000002401200000], sp=0x00000024011ff050, free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0x4d42df]
V [jvm.dll+0x4d819a]
V [jvm.dll+0x4d5eb7]
V [jvm.dll+0x84c11d]
V [jvm.dll+0x84ce62]
V [jvm.dll+0x84d38f]
V [jvm.dll+0x84d774]
V [jvm.dll+0x84d840]
V [jvm.dll+0x7f3a1c]
V [jvm.dll+0x68a7c7]
C [ucrtbase.dll+0x29333]
C [KERNEL32.DLL+0x1259d]
C [ntdll.dll+0x5af38]
siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0xffffffffffffffff
Registers:
RAX=0x90004f0018535edf, RBX=0x00000008012a02b0, RCX=0x000000240dbfc570, RDX=0x0000000000000000
RSP=0x00000024011ff050, RBP=0x00000024011ff239, RSI=0x000000240dbfc570, RDI=0x0000000000000014
R8 =0x00000124130251f8, R9 =0x000001240a8b2df0, R10=0x0000000000000007, R11=0x00000024011fefb0
R12=0x0000000000000000, R13=0x000001247fb34e00, R14=0x000001243031ee30, R15=0x000000240dbfc570
RIP=0x00007ffc2d9442df, EFLAGS=0x0000000000010246
Register to memory mapping:
RIP=0x00007ffc2d9442df jvm.dll
RAX=0x90004f0018535edf is an unknown value
RBX=0x00000008012a02b0 is pointing into metadata
RCX=0x000000240dbfc570 is pointing into the stack for thread: 0x0000012409b67a40
RDX=0x0 is NULL
RSP=0x00000024011ff050 points into unknown readable memory: 0x404e000000000000 | 00 00 00 00 00 00 4e 40
RBP=0x00000024011ff239 points into unknown readable memory: e2 a2 5b 24 01 00 00
RSI=0x000000240dbfc570 is pointing into the stack for thread: 0x0000012409b67a40
RDI=0x0000000000000014 is an unknown value
R8 =0x00000124130251f8 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00
R9 =0x000001240a8b2df0 points into unknown readable memory: 0x00007ffc2de0ed00 | 00 ed e0 2d fc 7f 00 00
R10=0x0000000000000007 is an unknown value
R11=0x00000024011fefb0 points into unknown readable memory: 0x000001245bbe5810 | 10 58 be 5b 24 01 00 00
R12=0x0 is NULL
R13=0x000001247fb34e00 points into unknown readable memory: 0x00007ffc2de70cd8 | d8 0c e7 2d fc 7f 00 00
R14=0x000001243031ee30 points into unknown readable memory: 0x00000006898b29d8 | d8 29 8b 89 06 00 00 00
R15=0x000000240dbfc570 is pointing into the stack for thread: 0x0000012409b67a40
I haven't yet found a way to create a simple reproducer since this is only happening in our more complex integration tests.