Skip to content

Commit 65a5488

Browse files
committed
8306712: CDS DeterministicDump.java test fails with -XX:+UseStringDeduplication
Reviewed-by: iklam, matsaave
1 parent d8b230c commit 65a5488

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/hotspot/share/runtime/arguments.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -3048,6 +3048,11 @@ jint Arguments::finalize_vm_init_args(bool patch_mod_javabase) {
30483048
// class metadata instead of modifying them in place. The copy is inaccessible to the compiler.
30493049
// TODO: revisit the following for the static archive case.
30503050
set_mode_flags(_int);
3051+
3052+
// String deduplication may cause CDS to iterate the strings in different order from one
3053+
// run to another which resulting in non-determinstic CDS archives.
3054+
// Disable UseStringDeduplication while dumping CDS archive.
3055+
UseStringDeduplication = false;
30513056
}
30523057

30533058
// RecordDynamicDumpInfo is not compatible with ArchiveClassesAtExit

test/hotspot/jtreg/runtime/cds/DeterministicDump.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -54,11 +54,6 @@ public static void doTest(boolean compressed) throws Exception {
5454
baseArgs.add("-Xmx128M");
5555

5656
if (Platform.is64bit()) {
57-
if (!compressed) {
58-
System.out.println("CDS archives with uncompressed oops are still non-deterministic");
59-
System.out.println("See https://bugs.openjdk.org/browse/JDK-8282828");
60-
return;
61-
}
6257
// These options are available only on 64-bit.
6358
String sign = (compressed) ? "+" : "-";
6459
baseArgs.add("-XX:" + sign + "UseCompressedOops");

0 commit comments

Comments
 (0)