JDK-8308781 : assert(has_cp_cache(i)) failed: oob in PerUserCfgTest.java
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2023-05-24
  • Updated: 2023-07-06
  • Resolved: 2023-06-06
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 21
21Resolved
Related Reports
Relates :  
Description
The following test failed in the JDK21 CI:

tools/jpackage/share/PerUserCfgTest.java

Here's a snippet from the log file:

[01:11:34.693] TRACE: Clearing PATH in environment
[01:11:34.700] TRACE: exec: Execute [/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S93576/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8ba24140-81d9-45d6-b7e6-6476e32c1817/runs/885d002d-23cb-4992-a8da-73d32c923e05/testoutput/test-support/jtreg_open_test_jdk_core_tools/scratch/1/./test/unpacked-dmg/Applications/PerUserCfgTest.app/Contents/MacOS/PerUserCfgTest](1); inherit I/O; in directory [./test]...
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S102729/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/bbe61961-dadd-4cd9-87c8-d308ce5bda5b/runs/40d80f16-c4cc-44c4-89b1-f1a79c1b7449/workspace/open/src/hotspot/share/interpreter/rewriter.hpp:86), pid=31519, tid=10243
#  assert(has_cp_cache(i)) failed: oob
#
# JRE version:  (21.0+24) (fastdebug build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 21-ea+24-LTS-2056, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Core dump will be written. Default location: core.31519
#
# An error report file with more information is saved as:
# /System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S93576/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8ba24140-81d9-45d6-b7e6-6476e32c1817/runs/885d002d-23cb-4992-a8da-73d32c923e05/testoutput/test-support/jtreg_open_test_jdk_core_tools/scratch/1/test/hs_err_pid31519.log
#
#
[01:11:38.355] TRACE: exec: Done. Exit code: 134
[01:11:43.563] TRACE: Clearing PATH in environment
[01:11:43.563] TRACE: exec: Execute [/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S93576/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8ba24140-81d9-45d6-b7e6-6476e32c1817/runs/885d002d-23cb-4992-a8da-73d32c923e05/testoutput/test-support/jtreg_open_test_jdk_core_tools/scratch/1/./test/unpacked-dmg/Applications/PerUserCfgTest.app/Contents/MacOS/PerUserCfgTest](1); inherit I/O; in directory [./test]...
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S102729/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/bbe61961-dadd-4cd9-87c8-d308ce5bda5b/runs/40d80f16-c4cc-44c4-89b1-f1a79c1b7449/workspace/open/src/hotspot/share/interpreter/rewriter.hpp:86), pid=31521, tid=5891
#  assert(has_cp_cache(i)) failed: oob
#
# JRE version:  (21.0+24) (fastdebug build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 21-ea+24-LTS-2056, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Core dump will be written. Default location: core.31521
#
# An error report file with more information is saved as:
# /System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S93576/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8ba24140-81d9-45d6-b7e6-6476e32c1817/runs/885d002d-23cb-4992-a8da-73d32c923e05/testoutput/test-support/jtreg_open_test_jdk_core_tools/scratch/1/test/hs_err_pid31521.log
#
#
[01:11:43.671] TRACE: exec: Done. Exit code: 134
[01:11:48.826] TRACE: Clearing PATH in environment
[01:11:48.826] TRACE: exec: Execute [/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S93576/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8ba24140-81d9-45d6-b7e6-6476e32c1817/runs/885d002d-23cb-4992-a8da-73d32c923e05/testoutput/test-support/jtreg_open_test_jdk_core_tools/scratch/1/./test/unpacked-dmg/Applications/PerUserCfgTest.app/Contents/MacOS/PerUserCfgTest](1); inherit I/O; in directory [./test]...
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S102729/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/bbe61961-dadd-4cd9-87c8-d308ce5bda5b/runs/40d80f16-c4cc-44c4-89b1-f1a79c1b7449/workspace/open/src/hotspot/share/interpreter/rewriter.hpp:86), pid=31522, tid=9987
#  assert(has_cp_cache(i)) failed: oob
#
# JRE version:  (21.0+24) (fastdebug build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 21-ea+24-LTS-2056, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-amd64)
# Core dump will be written. Default location: core.31522
#
# An error report file with more information is saved as:
# /System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S93576/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8ba24140-81d9-45d6-b7e6-6476e32c1817/runs/885d002d-23cb-4992-a8da-73d32c923e05/testoutput/test-support/jtreg_open_test_jdk_core_tools/scratch/1/test/hs_err_pid31522.log
#
#
[01:11:48.919] TRACE: exec: Done. Exit code: 134
[01:11:54.079] ERROR: Expected [0]. Actual [134]: Check command [/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S93576/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8ba24140-81d9-45d6-b7e6-6476e32c1817/runs/885d002d-23cb-4992-a8da-73d32c923e05/testoutput/test-support/jtreg_open_test_jdk_core_tools/scratch/1/./test/unpacked-dmg/Applications/PerUserCfgTest.app/Contents/MacOS/PerUserCfgTest](1) exited with 0 code
[01:11:54.190] [  FAILED  ] PerUserCfgTest.test; checks=55
[01:11:54.343] [==========] 1 tests ran
[01:11:54.343] [  PASSED  ] 0 tests
[01:11:54.498] [  FAILED  ] 1 test, listed below
[01:11:54.554] [  FAILED  ] PerUserCfgTest.test; workDir=[./test]
[01:11:54.623] 1 FAILED TEST
----------System.err:(62/4608)----------


Although the log file has reported three crashes, the test run's
artifacts menu is not showing any hs_err_pid file. They might
be present in the complete artifacts download.

Even though this is a jpackage test, the assertion failure is
happening in interpreter code so I'm starting this bug off
in hotspot/runtime for initial triage.
Comments
ILW = HLM = P3
30-05-2023

It's odd that it's in startup, which means something got corrupted on the machine. V [libjvm.dylib+0x13fc162] Threads::initialize_java_lang_classes(JavaThread*, JavaThread*)+0xce2 I couldn't find the core files in the download to see why it picked rewrite_member_reference to crash in.
26-05-2023

I've attached the three hs_err_pid files: -rw-r--r--@ 1 dcubed green 64380 May 24 10:45 hs_err_pid31519.log -rw-r--r--@ 1 dcubed green 64377 May 24 10:45 hs_err_pid31521.log -rw-r--r--@ 1 dcubed green 64377 May 24 10:45 hs_err_pid31522.log Here's the crashing thread's stack from hs_err_pid31519.log: --------------- T H R E A D --------------- Current thread (0x00007fca74018c10): JavaThread "main" [_thread_in_vm, id=10243, stack(0x000070000b8f8000,0x000070000b9f8000) (1024K)] Stack: [0x000070000b8f8000,0x000070000b9f8000], sp=0x000070000b9f6a90, free space=1018k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.dylib+0x14b9e49] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x739 (rewriter.hpp:86) V [libjvm.dylib+0x14ba54b] VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x3b V [libjvm.dylib+0x7da205] report_vm_error(char const*, int, char const*, char const*, ...)+0xc5 V [libjvm.dylib+0x121d77b] Rewriter::rewrite_member_reference(unsigned char*, int, bool)+0x1ab V [libjvm.dylib+0x121c656] Rewriter::scan_method(Thread*, Method*, bool, bool*)+0x96 V [libjvm.dylib+0x121f12b] Rewriter::rewrite_bytecodes(JavaThread*)+0xdb V [libjvm.dylib+0x121f809] Rewriter::Rewriter(InstanceKlass*, constantPoolHandle const&, Array<Method*>*, JavaThread*)+0x2b9 V [libjvm.dylib+0x121f3e3] Rewriter::rewrite(InstanceKlass*, JavaThread*)+0x143 V [libjvm.dylib+0xad4e7a] InstanceKlass::rewrite_class(JavaThread*)+0x3a V [libjvm.dylib+0xad452f] InstanceKlass::link_class_impl(JavaThread*)+0x47f V [libjvm.dylib+0xad43dd] InstanceKlass::link_class_impl(JavaThread*)+0x32d V [libjvm.dylib+0xad43dd] InstanceKlass::link_class_impl(JavaThread*)+0x32d V [libjvm.dylib+0xad2e62] InstanceKlass::initialize_impl(JavaThread*)+0x62 V [libjvm.dylib+0xad2d95] InstanceKlass::initialize(JavaThread*)+0x25 V [libjvm.dylib+0xedd9b5] LinkResolver::resolve_static_call(CallInfo&, LinkInfo const&, bool, JavaThread*)+0x95 V [libjvm.dylib+0xee2283] LinkResolver::resolve_invoke(CallInfo&, Handle, constantPoolHandle const&, int, Bytecodes::Code, JavaThread*)+0x163 V [libjvm.dylib+0xb0caa4] InterpreterRuntime::resolve_invoke(JavaThread*, Bytecodes::Code)+0x654 V [libjvm.dylib+0xb0ddbb] InterpreterRuntime::resolve_from_cache(JavaThread*, Bytecodes::Code)+0x11b j java.lang.Module.<clinit>()V+69 java.base v ~StubRoutines::call_stub 0x0000000120650d21 V [libjvm.dylib+0xb21558] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x618 V [libjvm.dylib+0xad6177] InstanceKlass::call_class_initializer(JavaThread*)+0x427 V [libjvm.dylib+0xad380f] InstanceKlass::initialize_impl(JavaThread*)+0xa0f V [libjvm.dylib+0xad2d95] InstanceKlass::initialize(JavaThread*)+0x25 V [libjvm.dylib+0x13fc162] Threads::initialize_java_lang_classes(JavaThread*, JavaThread*)+0xce2 V [libjvm.dylib+0x13fe0ee] Threads::create_vm(JavaVMInitArgs*, bool*)+0x61e V [libjvm.dylib+0xc2a923] JNI_CreateJavaVM+0x93 C [libjli.dylib+0x42b2] JavaMain+0x122 C [libjli.dylib+0x7229] ThreadJavaMain+0x9 C [libsystem_pthread.dylib+0x6109] _pthread_start+0x94 C [libsystem_pthread.dylib+0x1b8b] thread_start+0xf Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j java.lang.Module.<clinit>()V+69 java.base v ~StubRoutines::call_stub 0x0000000120650d21 The other two look largely the same.
24-05-2023