JDK-8278299 : CDS DynamicLoaderConstraintsTest.java/zgc failed "guarantee(offset <= MAX_SHARED_DELTA) failed: must be 32-bit offset"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 18
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2021-12-06
  • Updated: 2023-01-12
  • Resolved: 2023-01-12
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
Relates :  
Sub Tasks
JDK-8278310 :  
Description
The following test failed in the JDK18 CI:

runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java#custom-cl-zgc

Here's a snippet from the log file:

[0.300s][info][class,load              ] java.lang.invoke.LambdaForm$Holder
[0.302s][info][class,load              ] java.lang.Shutdown source: shared objects file
[0.302s][info][class,load              ] java.lang.Shutdown$Lock source: shared objects file
[0.317s][warning][cds                     ] Skipping com/sun/net/httpserver/HttpExchange: Not in loaded state
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (archiveBuilder.hpp:322), pid=60597, tid=43011
#  guarantee(offset <= MAX_SHARED_DELTA) failed: must be 32-bit offset
#
# JRE version: OpenJDK Runtime Environment (18.0+26) (build 18-ea+26-1792)
# Java VM: OpenJDK 64-Bit Server VM (18-ea+26-1792, mixed mode, sharing, tiered, compressed class ptrs, z gc, bsd-amd64)
# Core dump will be written. Default location: core.60597
#
# An error report file with more information is saved as:
# /System/Volumes/Data/mesos/work_dir/slaves/a2dc162d-743b-4800-9e92-31f85abb45b1-S53404/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/306bf501-e48f-4b8a-b491-9a947482b36d/runs/020a0a7c-01ad-4176-8b7f-6625e7fb940a/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_runtime/scratch/0/hs_err_pid60597.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
];
 stderr: []
 exitValue = 134

java.lang.RuntimeException: Expected to get exit value of [0]

	at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:489)
	at jdk.test.lib.cds.CDSTestUtils$Result.assertNormalExit(CDSTestUtils.java:195)
	at DynamicLoaderConstraintsTest.doTest(DynamicLoaderConstraintsTest.java:166)
	at DynamicLoaderConstraintsTest.doTest(DynamicLoaderConstraintsTest.java:117)
	at DynamicArchiveTestBase.runTest(DynamicArchiveTestBase.java:74)
	at DynamicLoaderConstraintsTest.main(DynamicLoaderConstraintsTest.java:108)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:833)

JavaTest Message: Test threw exception: java.lang.RuntimeException: Expected to get exit value of [0]

Here's the crashing thread's stack:

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

Current thread (0x00007f7f1b0186b0):  VMThread "VM Thread" [stack: 0x0000700002ae1000,0x0000700002be1000] [id=43011]

Stack: [0x0000700002ae1000,0x0000700002be1000],  sp=0x0000700002be0550,  free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0xa5ce53]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x6a3
V  [libjvm.dylib+0xa5d45b]  VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x3b
V  [libjvm.dylib+0x3546be]  report_vm_error(char const*, int, char const*, char const*, ...)+0xce
V  [libjvm.dylib+0x90aa87]  RunTimeClassInfo::init(DumpTimeClassInfo&)+0x147
V  [libjvm.dylib+0x9b310d]  CopySharedClassInfoToArchive::do_entry(InstanceKlass*, DumpTimeClassInfo&)+0xbd
V  [libjvm.dylib+0x9b10c0]  SystemDictionaryShared::write_to_archive(bool)+0x350
V  [libjvm.dylib+0x3d6e16]  DynamicArchiveBuilder::doit()+0x126
V  [libjvm.dylib+0x3d6bd8]  VM_PopulateDynamicDumpSharedSpace::doit()+0xc8
V  [libjvm.dylib+0xa621e6]  VM_Operation::evaluate()+0xd6
V  [libjvm.dylib+0xa67303]  VMThread::evaluate_operation(VM_Operation*)+0x103
V  [libjvm.dylib+0xa67d11]  VMThread::inner_execute(VM_Operation*)+0x2a1
V  [libjvm.dylib+0xa66fca]  VMThread::run()+0xba
V  [libjvm.dylib+0x9e33ef]  Thread::call_run()+0xcf
V  [libjvm.dylib+0x885b58]  thread_native_entry(Thread*)+0x148
C  [libsystem_pthread.dylib+0x6109]  _pthread_start+0x94
C  [libsystem_pthread.dylib+0x1b8b]  thread_start+0xf

VM_Operation (0x0000700001eb98b0): PopulateDumpSharedSpace, mode: safepoint, requested by thread 0x00007f7f1d00e000

There's another recently filed bug for the same test:

JDK-8277998 runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java#custom-cl-zgc failed "assert(ZAddress::is_marked(addr)) failed: Should be marked"
Comments
Closing as we cannot reproduce, and this has not shown up in our CI.
12-01-2023

ILW = MLM = P4
07-12-2021

Unfortunately a core file is not available and the logging is not sufficient to narrow down the cause of this bug. It could be related to JDK-8277998. The crash seems to be in one of the any_to_offset_u4 calls: ======= void RunTimeClassInfo::init(DumpTimeClassInfo& info) { ArchiveBuilder* builder = ArchiveBuilder::current(); ... _num_verifier_constraints = info.num_verifier_constraints(); int i; if (_num_verifier_constraints > 0) { RTVerifierConstraint* vf_constraints = verifier_constraints(); char* flags = verifier_constraint_flags(); for (i = 0; i < _num_verifier_constraints; i++) { vf_constraints[i]._name = builder->any_to_offset_u4(info._verifier_constraints->at(i)._name); <<<< ======= info._verifier_constraints->at(i) returns a DTVerifierConstraint. At this point of this call, info._verifier_constraints->at(i)._name should have been relocated and should be pointing into the buffer space. However, maybe the relocation did not happen and info._verifier_constraints->at(i)._name still points to the original Symbol.
06-12-2021