8306712: CDS DeterministicDump.java test fails with -XX:+UseStringDeduplication

Reviewed-by: iklam, matsaave
This commit is contained in:
Calvin Cheung 2023-05-05 17:39:40 +00:00
parent d8b230c384
commit 65a54883b3
2 changed files with 6 additions and 6 deletions

View File

@ -3048,6 +3048,11 @@ jint Arguments::finalize_vm_init_args(bool patch_mod_javabase) {
// class metadata instead of modifying them in place. The copy is inaccessible to the compiler.
// TODO: revisit the following for the static archive case.
set_mode_flags(_int);
// String deduplication may cause CDS to iterate the strings in different order from one
// run to another which resulting in non-determinstic CDS archives.
// Disable UseStringDeduplication while dumping CDS archive.
UseStringDeduplication = false;
}
// RecordDynamicDumpInfo is not compatible with ArchiveClassesAtExit

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -54,11 +54,6 @@ public class DeterministicDump {
baseArgs.add("-Xmx128M");
if (Platform.is64bit()) {
if (!compressed) {
System.out.println("CDS archives with uncompressed oops are still non-deterministic");
System.out.println("See https://bugs.openjdk.org/browse/JDK-8282828");
return;
}
// These options are available only on 64-bit.
String sign = (compressed) ? "+" : "-";
baseArgs.add("-XX:" + sign + "UseCompressedOops");