JDK-8267988 : C2: assert(!addp->is_AddP() || addp->in(AddPNode::Base)->is_top() || addp->in(AddPNode::Base) == n->in(AddPNode::Base)) failed: Base pointers must match (addp 1301)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2021-05-31
  • Updated: 2023-09-15
  • Resolved: 2021-06-16
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.
JDK 17 JDK 18
17 b27Fixed 18Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The attached fuzzer test starts to fail after JDK-8252372 with the following assertion:

To reproduce:
$ java -Xcomp -XX:CompileOnly=Test Test.java
$ java -Xcomp -XX:CompileOnly=Reduced Reduced.java

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/3c846bae-ce30-4a97-93ee-9fef4497ccb6-S79138/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/1e84e880-665b-4ce6-a86d-5a8778302ad6/runs/5aaa51c3-47d3-43d6-b2dc-734ff90b359e/workspace/open/src/hotspot/share/opto/compile.cpp:3065), pid=30028, tid=30041
#  assert(!addp->is_AddP() || addp->in(AddPNode::Base)->is_top() || addp->in(AddPNode::Base) == n->in(AddPNode::Base)) failed: Base pointers must match (addp 1301)
#
# JRE version: Java(TM) SE Runtime Environment (17.0+24) (fastdebug build 17-ea+24-LTS-2164)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 17-ea+24-LTS-2164, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xa0ce2a]  Compile::final_graph_reshaping_main_switch(Node*, Final_Reshape_Counts&, unsigned int)+0x176a
.............
Command Line: -Xmx1G -Xcomp -Xbatch -XX:CompileOnly=Test -XX:CompileCommand=quiet Test
.............
Current thread (0x00007ff38047f390):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=30041, stack(0x00007ff34f6ff000,0x00007ff34f800000)]


Current CompileTask:
C2:    388   14   !b  4       Test::fMeth (332 bytes)

Stack: [0x00007ff34f6ff000,0x00007ff34f800000],  sp=0x00007ff34f7fb100,  free space=1008k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xa0ce2a]  Compile::final_graph_reshaping_main_switch(Node*, Final_Reshape_Counts&, unsigned int)+0x176a
V  [libjvm.so+0xa0d365]  Compile::final_graph_reshaping_impl(Node*, Final_Reshape_Counts&) [clone .part.0]+0x85
V  [libjvm.so+0xa0dad8]  Compile::final_graph_reshaping_walk(Node_Stack&, Node*, Final_Reshape_Counts&)+0x198
V  [libjvm.so+0xa0f8be]  Compile::final_graph_reshaping()+0x3ce
V  [libjvm.so+0xa1b62f]  Compile::Optimize()+0x196f
V  [libjvm.so+0xa1cc95]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x1585
V  [libjvm.so+0x840f1a]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1ea
V  [libjvm.so+0xa2d699]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xfb9
V  [libjvm.so+0xa2e408]  CompileBroker::compiler_thread_loop()+0x5a8
V  [libjvm.so+0x18a3e21]  JavaThread::thread_main_inner()+0x271
V  [libjvm.so+0x18ab9e0]  Thread::call_run()+0x100
V  [libjvm.so+0x157751e]  thread_native_entry(Thread*)+0x10e

Comments
Changeset: 4d545a1f Author: Roland Westrelin <roland@openjdk.org> Date: 2021-06-16 07:36:07 +0000 URL: https://git.openjdk.java.net/jdk17/commit/4d545a1f86325140ed268c5437d776ceb8e21077
16-06-2021

ILW = Assert during C2 compilation (recent regression in JDK 17), observing this often with JavaFuzzer generated tests, no known workaround but disable C2 compilation of affected method = HMM = P2 [~roland] Can you take a look at it?
07-06-2021