mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8005076: Creating a CDS archive with one alignment and running another causes a crash
Save the alignment when writing the CDS and compare it when reading the CDS. Reviewed-by: kvn, coleenp
This commit is contained in:
parent
89e575df23
commit
cfea76669a
4 changed files with 19 additions and 16 deletions
|
@ -1331,14 +1331,14 @@ bool verify_object_alignment() {
|
|||
// then a saved space from compressed oops.
|
||||
if ((int)ObjectAlignmentInBytes > 256) {
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"error: ObjectAlignmentInBytes=%d must not be greater then 256\n",
|
||||
"error: ObjectAlignmentInBytes=%d must not be greater than 256\n",
|
||||
(int)ObjectAlignmentInBytes);
|
||||
return false;
|
||||
}
|
||||
// In case page size is very small.
|
||||
if ((int)ObjectAlignmentInBytes >= os::vm_page_size()) {
|
||||
jio_fprintf(defaultStream::error_stream(),
|
||||
"error: ObjectAlignmentInBytes=%d must be less then page size %d\n",
|
||||
"error: ObjectAlignmentInBytes=%d must be less than page size %d\n",
|
||||
(int)ObjectAlignmentInBytes, os::vm_page_size());
|
||||
return false;
|
||||
}
|
||||
|
@ -2997,11 +2997,6 @@ void Arguments::set_shared_spaces_flags() {
|
|||
FLAG_SET_DEFAULT(UseLargePages, false);
|
||||
}
|
||||
|
||||
// Add 2M to any size for SharedReadOnlySize to get around the JPRT setting
|
||||
if (DumpSharedSpaces && !FLAG_IS_DEFAULT(SharedReadOnlySize)) {
|
||||
SharedReadOnlySize = 14*M;
|
||||
}
|
||||
|
||||
if (DumpSharedSpaces) {
|
||||
if (RequireSharedSpaces) {
|
||||
warning("cannot dump shared archive while using shared archive");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue