JDK-8352655 : C2 crash: assert(which == call32_operand) failed: call has no disp32 or imm
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 25
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2025-03-24
  • Updated: 2025-04-22
  • Resolved: 2025-04-22
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.
Other
tbdResolved
Related Reports
Duplicate :  
Description
Failing test:

compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java	

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/03ecc23a-edd5-4bb5-a333-4ff8ea07fd7c-S1424/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/1aca48e5-115d-43f7-a742-7bdead46d616/runs/f1e3e751-666b-4418-90ff-fb141a482e3a/workspace/open/src/hotspot/cpu/x86/assembler_x86.cpp:1178), pid=2241226, tid=2241249
#  assert(which == call32_operand) failed: call has no disp32 or imm
#
# JRE version: Java(TM) SE Runtime Environment (25.0+16) (fastdebug build 25-ea+16-LTS-1719)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 25-ea+16-LTS-1719, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x65182f]  Assembler::locate_operand(unsigned char*, Assembler::WhichOperand)+0x5cf
#
# Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /opt/mach5/mesos/work_dir/slaves/d14b0f60-a475-4b75-84a6-b4452f3162de-S13907/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c4ba79a-1620-4f63-89d7-b4e43315b5c8/runs/c0375173-cf09-4b6a-bdd9-93fa15772cb8/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier3_compiler/scratch/5/core.2241226)
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

---------------  S U M M A R Y ------------

Command Line: -Dtest.vm.opts=-XX:MaxRAMPercentage=4.16667 -Dtest.boot.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk/23/37/bundles/linux-x64/jdk-23_linux-x64_bin.tar.gz/jdk-23 -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/d14b0f60-a475-4b75-84a6-b4452f3162de-S13907/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c4ba79a-1620-4f63-89d7-b4e43315b5c8/runs/c0375173-cf09-4b6a-bdd9-93fa15772cb8/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier3_compiler/tmp -Dtest.tool.vm.opts=-J-XX:MaxRAMPercentage=4.16667 -J-Dtest.boot.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk/23/37/bundles/linux-x64/jdk-23_linux-x64_bin.tar.gz/jdk-23 -J-Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/d14b0f60-a475-4b75-84a6-b4452f3162de-S13907/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c4ba79a-1620-4f63-89d7-b4e43315b5c8/runs/c0375173-cf09-4b6a-bdd9-93fa15772cb8/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier3_compiler/tmp -Dtest.compiler.opts= -Dtest.java.opts=-Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -server -XX:-TieredCompilation -XX:+DeoptimizeALot -Dtest.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk-25+16-1719/linux-x64-debug.jdk/jdk-25/fastdebug -Dcompile.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk-25+16-1719/linux-x64-debug.jdk/jdk-25/fastdebug -Dtest.timeout.factor=16.0 -Dtest.nativepath=/opt/mach5/mesos/work_dir/jib-master/install/jdk-25+16-1719/linux-x64-debug.test/hotspot/jtreg/native -Dtest.root=/opt/mach5/mesos/work_dir/jib-master/install/jdk-25+16-1719/src.full/open/test/hotspot/jtreg -Dtest.name=compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java -Dtest.verbose=Verbose[p=BRIEF,f=FULL,e=FULL,t=true,m=false] -Dtest.file=/opt/mach5/mesos/work_dir/jib-master/install/jdk-25+16-1719/src.full/open/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java -Dtest.src=/opt/mach5/mesos/work_dir/jib-master/install/jdk-25+16-1719/src.full/open/test/hotspot/jtreg/compiler/compilercontrol -Dtest.src.path=/opt/mach5/mesos/work_dir/jib-master/install/jdk-25+16-1719/src.full/open/test/hotspot/jtreg/compiler/compilercontrol:/opt/mach5/mesos/work_dir/jib-master/install/jdk-25+16-1719/src.full/open/test/lib:/opt/mach5/mesos/work_dir/jib-master/install/jdk-25+16-1719/src.full/open/test/hotspot/jtreg -Dtest.classes=/opt/mach5/mesos/work_dir/slaves/d14b0f60-a475-4b75-84a6-b4452f3162de-S13907/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c4ba79a-1620-4f63-89d7-b4e43315b5c8/runs/c0375173-cf09-4b6a-bdd9-93fa15772cb8/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier3_compiler/classes/3/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.d -Dtest.class.path=/opt/mach5/mesos/work_dir/slaves/d14b0f60-a475-4b75-84a6-b4452f3162de-S13907/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c4ba79a-1620-4f63-89d7-b4e43315b5c8/runs/c0375173-cf09-4b6a-bdd9-93fa15772cb8/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier3_compiler/classes/3/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.d:/opt/mach5/mesos/work_dir/slaves/d14b0f60-a475-4b75-84a6-b4452f3162de-S13907/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c4ba79a-1620-4f63-89d7-b4e43315b5c8/runs/c0375173-cf09-4b6a-bdd9-93fa15772cb8/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier3_compiler/classes/3/test/lib:/opt/mach5/mesos/work_dir/slaves/d14b0f60-a475-4b75-84a6-b4452f3162de-S13907/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c4ba79a-1620-4f63-89d7-b4e43315b5c8/runs/c0375173-cf09-4b6a-bdd9-93fa15772cb8/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier3_compiler/classes/3 -Dtest.class.path.prefix=/opt/mach5/mesos/work_dir/slaves/d14b0f60-a475-4b75-84a6-b4452f3162de-S13907/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c4ba79a-1620-4f63-89d7-b4e43315b5c8/runs/c0375173-cf09-4b6a-bdd9-93fa15772cb8/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier3_compiler/classes/3/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.d:/opt/mach5/mesos/work_dir/jib-master/install/jdk-25+16-1719/src.full/open/test/hotspot/jtreg/compiler/compilercontrol:/opt/mach5/mesos/work_dir/slaves/d14b0f60-a475-4b75-84a6-b4452f3162de-S13907/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c4ba79a-1620-4f63-89d7-b4e43315b5c8/runs/c0375173-cf09-4b6a-bdd9-93fa15772cb8/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier3_compiler/classes/3/test/lib:/opt/mach5/mesos/work_dir/slaves/d14b0f60-a475-4b75-84a6-b4452f3162de-S13907/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c4ba79a-1620-4f63-89d7-b4e43315b5c8/runs/c0375173-cf09-4b6a-bdd9-93fa15772cb8/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier3_compiler/classes/3 -Dtest.modules=java.base/jdk.internal.misc java.compiler java.management --add-modules=java.base,java.compiler,java.management --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED -XX:MaxRAMPercentage=4.16667 -Dtest.boot.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk/23/37/bundles/linux-x64/jdk-23_linux-x64_bin.tar.gz/jdk-23 -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/d14b0f60-a475-4b75-84a6-b4452f3162de-S13907/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c4ba79a-1620-4f63-89d7-b4e43315b5c8/runs/c0375173-cf09-4b6a-bdd9-93fa15772cb8/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier3_compiler/tmp -Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -XX:-TieredCompilation -XX:+DeoptimizeALot -Djava.library.path=/opt/mach5/mesos/work_dir/jib-master/install/jdk-25+16-1719/linux-x64-debug.test/hotspot/jtreg/native -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly -XX:+WhiteBoxAPI com.sun.javatest.regtest.agent.MainWrapper /opt/mach5/mesos/work_dir/slaves/d14b0f60-a475-4b75-84a6-b4452f3162de-S13907/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4c4ba79a-1620-4f63-89d7-b4e43315b5c8/runs/c0375173-cf09-4b6a-bdd9-93fa15772cb8/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier3_compiler/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.d/testng.0.jta compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java false compiler.compilercontrol.TestCompilerDirectivesCompatibilityFlag

Host: AMD EPYC 9J14 96-Core Processor, 12 cores, 23G, Oracle Linux Server release 8.10
Time: Sun Mar 23 06:17:02 2025 UTC elapsed time: 6.845258 seconds (0d 0h 0m 6s)

---------------  T H R E A D  ---------------

Current thread (0x00007f0c8c07ab50):  JavaThread "C2 CompilerThread3" daemon [_thread_in_vm, id=2241249, stack(0x00007f0cfed47000,0x00007f0cfee47000) (1024K)]


Current CompileTask:
C2:6845  592             sun.security.util.KnownOIDs::register (349 bytes)

Stack: [0x00007f0cfed47000,0x00007f0cfee47000],  sp=0x00007f0cfee42810,  free space=1006k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x65182f]  Assembler::locate_operand(unsigned char*, Assembler::WhichOperand)+0x5cf  (assembler_x86.cpp:1178)
V  [libjvm.so+0x174bffa]  RelocIterator::print_current()+0x91a  (relocInfo.cpp:847)
V  [libjvm.so+0x174c654]  RelocIterator::print()+0x1b4  (relocInfo.cpp:973)
V  [libjvm.so+0x15900bb]  nmethod::print_relocations()+0x14b  (nmethod.cpp:3246)
V  [libjvm.so+0x159878b]  nmethod::print_nmethod(bool)+0x3cb  (nmethod.cpp:1699)
V  [libjvm.so+0x950bd3]  ciEnv::register_method(ciMethod*, int, CodeOffsets*, int, CodeBuffer*, int, OopMapSet*, ExceptionHandlerTable*, ImplicitExceptionTable*, AbstractCompiler*, bool, bool, bool, bool, int)+0x863  (ciEnv.cpp:1127)
V  [libjvm.so+0x163f63a]  PhaseOutput::install_code(ciMethod*, int, AbstractCompiler*, bool, bool)+0x16a  (output.cpp:3442)
V  [libjvm.so+0xa85d10]  Compile::Code_Gen()+0xa80  (compile.cpp:3084)
V  [libjvm.so+0xa8aece]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1fee  (compile.cpp:893)
V  [libjvm.so+0x8c55a0]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x440  (c2compiler.cpp:141)
V  [libjvm.so+0xa98542]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xb22  (compileBroker.cpp:2331)
V  [libjvm.so+0xa99558]  CompileBroker::compiler_thread_loop()+0x598  (compileBroker.cpp:1975)
V  [libjvm.so+0xf9409f]  JavaThread::thread_main_inner()+0x12f  (javaThread.cpp:776)
V  [libjvm.so+0x19756e6]  Thread::call_run()+0xb6  (thread.cpp:231)
V  [libjvm.so+0x161d4c8]  thread_native_entry(Thread*)+0x128  (os_linux.cpp:877)
Registers:
RAX=0x00007f0d23aa6000, RBX=0x00007f0d22da4060, RCX=0x00007f0d22787ebe, RDX=0x00007f0d22802510
RSP=0x00007f0cfee42810, RBP=0x00007f0cfee42810, RSI=0x000000000000049a, RDI=0x00007f0d228020e0
R8 =0x00007f0d10a3fa80, R9 =0x0000000000000000, R10=0x00007f0d10a3fa81, R11=0x0000000000000000
R12=0x00007f0cfee42a00, R13=0x00007f0cfee42a70, R14=0x00007f0d22e07864, R15=0x00007f0d23545728
RIP=0x00007f0d2121382f, EFLAGS=0x0000000000010293, CSGSFS=0x002b000000000033, ERR=0x0000000000000006
  TRAPNO=0x000000000000000e
Comments
Sounds good, I think this is enough evidence. Let's close this as dup of JDK-8258229 for now - we can always re-open it.
22-04-2025

I see in a comment here that the jump is after a int3. Is that a hint it could be the start of the method? That would be another similar thing with JDK-8258229 (as far as I know...).
22-04-2025

Just by looking at the jump address where printing fails, I think that this is the same thing as JDK-8258229. To be sure you can enable logging of deoptimizations. Then, whenever printing the assembly fails you should see a deoptimization with a deopt action that makes the method not entrant. This jump is added with patch_verified_entry, which is why the relocation information does not match the actual instruction.
22-04-2025

It's hard to be sure without actually solving it, but it has exactly the same stack, hitting the same assert (see your comment https://bugs.openjdk.org/browse/JDK-8258229?focusedId=14730774&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14730774 ) Both are about printing relocation info of a jmp (using the opcode e9). Overall, I cannot see any difference between both tickets. Maybe [~mhassig] will find some difference?
22-04-2025

[~mchevalier] Are you sure it's the same issue?
22-04-2025

I think we can close this one as a duplicate of JDK-8258229. And like this one, this other issue is very rare!
17-04-2025

ILW = Assert during printing of relocations, intermittent with single test and -XX:+PrintAssembly; not reproducible, no workaround but exclude affected method from printing = MLH = P4
24-03-2025

We crash when printing relocation info: relocations: @0x00007f0c84094b20: 6000 relocInfo@0x00007f0c84094b20 [type=12(metadata) addr=0x00007f0d10a3fa80 offset=0]# # A fatal error has been detected by the Java Runtime Environment: I had a quick look at the core file and the instructions around the address look sane: 0x7f0d10a3fa7f: int3 0x7f0d10a3fa80: jmp 0x7f0d10828f60 <--- 0x7f0d10a3fa85: mov $0xc,%bl 0x7f0d10a3fa87: jg 0x7f0d10a3fa89 0x7f0d10a3fa80: 0xe9 0xdb 0x94 0xde 0xff 0xb3 0x0c 0x7f 0x7f0d10a3fa88: 0x00 0x00 0x41 0x80 0xba 0x38 0x01 0x00
24-03-2025

Does not reproduce with replay compilation. Also did not reproduce with 2000 runs of the exact same test in the same configuration. I wonder if this depends on the memory layout of the code cache or something.
24-03-2025