JDK-8273359 : CI: ciInstanceKlass::get_canonical_holder() doesn't respect instance size
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-09-05
  • Updated: 2025-02-05
  • Resolved: 2021-09-08
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 15 JDK 17 JDK 18
15.0.7Fixed 17.0.2Fixed 18 b14Fixed
Related Reports
Relates :  
Description
The following test failed in the JDK18 CI:

java/util/stream/test/org/openjdk/tests/java/util/stream/DoublePrimitiveOpsTests.java

Here's a snippet from the log file:

#section:testng
----------messages:(5/396)----------
command: testng org.openjdk.tests.java.util.stream.DoublePrimitiveOpsTests
reason: Assumed action based on file name: run testng org.openjdk.tests.java.util.stream.DoublePrimitiveOpsTests 
Mode: othervm [test requires non-default system module, test or library overrides a system module]
Additional options from @modules: --add-modules jdk.incubator.foreign
elapsed time (seconds): 1188.404
----------configuration:(5/226)*----------
Boot Layer
  add modules: jdk.incubator.foreign 
  add reads:   java.base ALL-UNNAMED
  patch:       java.base T:\\testoutput\\test-support\\jtreg_open_test_jdk_jdk_util\\classes\\5\\lib\\testlibrary\\bootlib\\java.base

----------System.out:(23/1755)*----------
test org.openjdk.tests.java.util.stream.DoublePrimitiveOpsTests.testFlags(): success
test org.openjdk.tests.java.util.stream.DoublePrimitiveOpsTests.testLimit(): success
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=\\compile.cpp:1596
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (t:\\workspace\\open\\src\\hotspot\\share\\opto\\compile.cpp:1596), pid=52068, tid=41388
#  assert(flat == flatten_alias_type(flat)) failed: not idempotent: adr_type = java/util/stream/Nodes$SizedCollectorTask:NotNull+68 * [narrow]; flat = java/util/concurrent/ForkJoinTask+68 * [narrow] => oopptr:BotPTR+any [narrow]
#
# JRE version: Java(TM) SE Runtime Environment (18.0+14) (fastdebug build 18-ea+14-700)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18-ea+14-700, compiled mode, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Core dump will be written. Default location: T:\\testoutput\\test-support\\jtreg_open_test_jdk_jdk_util\\java\\util\\stream\\test\\org\\openjdk\\tests\\java\\util\\stream\\DoublePrimitiveOpsTests\\hs_err_pid52068.mdmp
#
# An error report file with more information is saved as:
# T:\\testoutput\\test-support\\jtreg_open_test_jdk_jdk_util\\java\\util\\stream\\test\\org\\openjdk\\tests\\java\\util\\stream\\DoublePrimitiveOpsTests\\hs_err_pid52068.log
#
# Compiler replay data is saved as:
# T:\\testoutput\\test-support\\jtreg_open_test_jdk_jdk_util\\java\\util\\stream\\test\\org\\openjdk\\tests\\java\\util\\stream\\DoublePrimitiveOpsTests\\replay_pid52068.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
----------System.err:(1/57)----------
WARNING: Using incubator modules: jdk.incubator.foreign
----------rerun:(56/6080)*----------

<snip>

result: Failed. Unexpected exit from test [exit code: 1]


Here's the crashing thread's stack:

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

Current thread (0x000001bc4591f460):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=41388, stack(0x000000b4a0500000,0x000000b4a0600000)]


Current CompileTask:
C2: 115247 11801    b  4       java.util.concurrent.ForkJoinPool::scan (235 bytes)

Stack: [0x000000b4a0500000,0x000000b4a0600000]
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0xad7791]  os::platform_print_native_stack+0xf1  (os_windows_x86.cpp:235)
V  [jvm.dll+0xcf45c5]  VMError::report+0x1005  (vmError.cpp:742)
V  [jvm.dll+0xcf5f4e]  VMError::report_and_die+0x7fe  (vmError.cpp:1552)
V  [jvm.dll+0xcf66d4]  VMError::report_and_die+0x64  (vmError.cpp:1333)
V  [jvm.dll+0x4c9267]  report_vm_error+0xb7  (debug.cpp:282)
V  [jvm.dll+0x4891ff]  Compile::find_alias_type+0x17f  (compile.cpp:1595)
V  [jvm.dll+0xa2998f]  MemNode::Ideal_common+0x68f  (memnode.cpp:368)
V  [jvm.dll+0xa271c9]  LoadNode::Ideal+0x39  (memnode.cpp:1716)
V  [jvm.dll+0xb1a211]  PhaseIterGVN::transform_old+0xc1  (phaseX.cpp:1258)
V  [jvm.dll+0xb1779f]  PhaseIterGVN::optimize+0x2cf  (phaseX.cpp:1206)
V  [jvm.dll+0x48d5cb]  PhaseIdealLoop::optimize+0x16b  (loopnode.hpp:1153)
V  [jvm.dll+0x481a14]  Compile::Optimize+0xc04  (compile.cpp:2210)
V  [jvm.dll+0x47eda7]  Compile::Compile+0x1457  (compile.cpp:785)
V  [jvm.dll+0x3b20c1]  C2Compiler::compile_method+0x121  (c2compiler.cpp:110)
V  [jvm.dll+0x497d2f]  CompileBroker::invoke_compiler_on_method+0x7bf  (compileBroker.cpp:2290)
V  [jvm.dll+0x495657]  CompileBroker::compiler_thread_loop+0x2b7  (compileBroker.cpp:1966)
V  [jvm.dll+0xc80bdd]  JavaThread::thread_main_inner+0x1fd  (thread.cpp:1272)
V  [jvm.dll+0xc77174]  Thread::call_run+0x1b4  (thread.cpp:365)
V  [jvm.dll+0xad614e]  thread_native_entry+0xae  (os_windows.cpp:549)
C  [ucrtbase.dll+0x1fb80]
C  [KERNEL32.DLL+0x84d4]
C  [ntdll.dll+0x51781]
Comments
A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk15u-dev/pull/159 Date: 2022-01-25 08:09:22 +0000
25-01-2022

Fix request (15u): to fix the regression where it has been introduced. The patch applies not exactly clean because of some context differences. The relevant tests run OK: the included test doesn't fail on 15u even before the fix:-(
25-01-2022

Fix request (17u): The bug leads to an assert during JIT compilation. The fix is medium risk and has been tested in the JDK 18 for a while and with tier1-3 in JDK 17u. The patch applies cleanly.
28-09-2021

The fix is integrated in jdk-18+14-752.
09-09-2021

Changeset: f7e9f56e Author: Vladimir Ivanov <vlivanov@openjdk.org> Date: 2021-09-08 16:17:56 +0000 URL: https://git.openjdk.java.net/jdk/commit/f7e9f56e235dc50daae0a85c9790d5b04c9c60f0
08-09-2021

ILW = assert in debug build, one test = MMH = P3
08-09-2021

It's a regression from JDK-8237767 which went into 15.
07-09-2021