RFR: 8247522: assert(is_aligned(class_space_rs.base(), class_space_alignment)) failed: Sanity
jiefu(傅杰)
jiefu at tencent.com
Sat Jun 13 15:14:55 UTC 2020
Hi Thomas,
Thanks for your review and nice comments.
The bug was first found on Linux/x86 machines with our Tencent tlinux OS.
Updated: http://cr.openjdk.java.net/~jiefu/8247522/webrev.01/
Your change is really cool.
With your patch, I can even reproduce the bug on our macOS platforms.
Thanks a lot.
Best regards,
Jie
From: Thomas Stüfe <thomas.stuefe at gmail.com>
Date: Saturday, June 13, 2020 at 8:41 PM
To: "jiefu(傅杰)" <jiefu at tencent.com>
Cc: "hotspot-runtime-dev at openjdk.java.net" <hotspot-runtime-dev at openjdk.java.net>
Subject: Re: RFR: 8247522: assert(is_aligned(class_space_rs.base(), class_space_alignment)) failed: Sanity(Internet mail)
Hi Jie,
good catch! What platform did this occur on?
Please remove the casts, you do not need them.
Please add the following lines to your patch - these test modifications trigger the bug also on linux x64:
---------------
diff -r 19b3969274ce test/hotspot/jtreg/runtime/cds/SharedBaseAddress.java
--- a/test/hotspot/jtreg/runtime/cds/SharedBaseAddress.java Thu Jun 11 12:51:09 2020 +0200
+++ b/test/hotspot/jtreg/runtime/cds/SharedBaseAddress.java Sat Jun 13 14:36:46 2020 +0200
@@ -41,6 +41,7 @@
"1g", "8g", "64g","512g", "4t",
"32t", "128t", "0",
"1", "64k", "64M",
+ "0x800001000", // Default base address + 1 page - probably valid but unaligned to metaspace alignment, see JDK 8247522
"0xfffffffffff00000", // archive top wraps around 64-bit address space
"0xfff80000", // archive top wraps around 32-bit address space
"0xffffffffffffffff", // archive bottom wraps around 64-bit address space -- due to align_up()
diff -r 19b3969274ce test/hotspot/jtreg/runtime/cds/appcds/SharedBaseAddress.java
--- a/test/hotspot/jtreg/runtime/cds/appcds/SharedBaseAddress.java Thu Jun 11 12:51:09 2020 +0200
+++ b/test/hotspot/jtreg/runtime/cds/appcds/SharedBaseAddress.java Sat Jun 13 14:36:46 2020 +0200
@@ -41,7 +41,8 @@
private static final String[] testTable = {
"1g", "8g", "64g","512g", "4t",
"32t", "128t", "0",
- "1", "64k", "64M", "320g"
+ "1", "64k", "64M", "320g",
+ "0x800001000" // Default base address + 1 page - probably valid but unaligned to metaspace alignment, see JDK 8247522
};
public static void main(String[] args) throws Exception {
---------------
Thanks, Thomas
On Sat, Jun 13, 2020 at 11:44 AM jiefu(傅杰) <jiefu at tencent.com<mailto:jiefu at tencent.com>> wrote:
Hi all,
JBS: https://bugs.openjdk.java.net/browse/JDK-8247522
Webrev: http://cr.openjdk.java.net/~jiefu/8247522/webrev.00/
This bug was triggered after JDK-8245707.
The reason is that ccs_begin_offset[1] is incorrect when archive_space_alignment != class_space_alignment.
Before JDK-8245707, archive_space_alignment = class_space_alignment = 4k.
After JDK-8245707, archive_space_alignment = 4k, class_space_alignment = 16k.
When the assert happened, we had observed base_address[2] = 4096, which is unaligned to class_space_alignment=16k.
- Testing:
tier1 on Linux/x64
Thanks a lot.
Best regards,
Jie
[1] http://hg.openjdk.java.net/jdk/jdk15/file/1c81917f228b/src/hotspot/share/memory/metaspaceShared.cpp#l2505
[2] http://hg.openjdk.java.net/jdk/jdk15/file/1c81917f228b/src/hotspot/share/memory/metaspaceShared.cpp#l2514
More information about the hotspot-runtime-dev
mailing list