8253079: DeterministicDump.java fails due to garbage in structure padding
Reviewed-by: minqi, jiefu, shade
This commit is contained in:
parent
a4affd5b04
commit
284bbf02dd
@ -454,6 +454,7 @@ void ModuleEntry::init_as_archived_entry() {
|
|||||||
if (_location != NULL) {
|
if (_location != NULL) {
|
||||||
_location = ArchiveBuilder::get_relocated_symbol(_location);
|
_location = ArchiveBuilder::get_relocated_symbol(_location);
|
||||||
}
|
}
|
||||||
|
JFR_ONLY(set_trace_id(0));// re-init at runtime
|
||||||
|
|
||||||
ArchivePtrMarker::mark_pointer((address*)&_reads);
|
ArchivePtrMarker::mark_pointer((address*)&_reads);
|
||||||
ArchivePtrMarker::mark_pointer((address*)&_version);
|
ArchivePtrMarker::mark_pointer((address*)&_version);
|
||||||
|
@ -238,6 +238,7 @@ void PackageEntry::init_as_archived_entry() {
|
|||||||
_module = ModuleEntry::get_archived_entry(_module);
|
_module = ModuleEntry::get_archived_entry(_module);
|
||||||
_qualified_exports = (GrowableArray<ModuleEntry*>*)archived_qualified_exports;
|
_qualified_exports = (GrowableArray<ModuleEntry*>*)archived_qualified_exports;
|
||||||
_defined_by_cds_in_class_path = 0;
|
_defined_by_cds_in_class_path = 0;
|
||||||
|
JFR_ONLY(set_trace_id(0)); // re-init at runtime
|
||||||
|
|
||||||
ArchivePtrMarker::mark_pointer((address*)literal_addr());
|
ArchivePtrMarker::mark_pointer((address*)literal_addr());
|
||||||
ArchivePtrMarker::mark_pointer((address*)&_module);
|
ArchivePtrMarker::mark_pointer((address*)&_module);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -95,6 +95,10 @@ template <class T, MEMFLAGS F> HashtableEntry<T, F>* Hashtable<T, F>::new_entry(
|
|||||||
template <class T, MEMFLAGS F> HashtableEntry<T, F>* Hashtable<T, F>::allocate_new_entry(unsigned int hashValue, T obj) {
|
template <class T, MEMFLAGS F> HashtableEntry<T, F>* Hashtable<T, F>::allocate_new_entry(unsigned int hashValue, T obj) {
|
||||||
HashtableEntry<T, F>* entry = (HashtableEntry<T, F>*) NEW_C_HEAP_ARRAY(char, this->entry_size(), F);
|
HashtableEntry<T, F>* entry = (HashtableEntry<T, F>*) NEW_C_HEAP_ARRAY(char, this->entry_size(), F);
|
||||||
|
|
||||||
|
if (DumpSharedSpaces) {
|
||||||
|
// Avoid random bits in structure padding so we can have deterministic content in CDS archive
|
||||||
|
memset((void*)entry, 0, this->entry_size());
|
||||||
|
}
|
||||||
entry->set_hash(hashValue);
|
entry->set_hash(hashValue);
|
||||||
entry->set_literal(obj);
|
entry->set_literal(obj);
|
||||||
entry->set_next(NULL);
|
entry->set_next(NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user