dragonwell-project / dragonwell21

GNU General Public License v2.0
67 stars 19 forks source link

[21.0.5.0.5+9]-XX:+UseCompactObjectHeaders选项runtime/locking/TestRecursiveMonitorChurn.java报错 Allocated too many monitors #125

Open sendaoYan opened 5 days ago

sendaoYan commented 5 days ago

https://tone.aliyun-inc.com/ws/xesljfzh/test_result/394873?tab=1
【环境准备】

BINARY_URL=oss://dragonwell/21.0.5.0.5+9-test-dragonwell_extended/Alibaba_Dragonwell_Extended_21.0.5.0.5.9_x64_linux.tar.gz
TEST_IMAGE=oss://dragonwell/21.0.5.0.5+9-test-dragonwell_extended/Alibaba_Dragonwell_Extended_21.0.5.0.5.9_x64_linux-testimage.tar.gz
JTREG_URL=oss://compiler-ci-bucket/jdk/tools/jtreg-7.3.1.1.zip
JDK_REPO=git@github.com:dragonwell-project/dragonwell21.git
JDK_BRANCH=dragonwell_extended-21.0.5.0.5+9
cd ~/tone/tone-matrix-compiler/common;./ossutil.bin_$(arch) -i;cd -
alias oss="~/tone/tone-matrix-compiler/common/ossutil.bin_$(arch) -e oss-cn-hangzhou.aliyuncs.com -u jvm_dev-b  ~/tone/tone-matrix-compiler/common/ossutil_bin/ossutil -o download -f -r"

部署二进制:
oss $BINARY_URL -l ${BINARY_URL##*/}
mkdir bin-dragonwell21;tar -xf ${BINARY_URL##*/} -C bin-dragonwell21
oss $TEST_IMAGE-l ${TEST_IMAGE##*/}
tar -xf ${BINARY_URL##*/} 

部署jtreg工具:
oss $JTREG_URL -l ${JTREG_URL##*/};unzip ${JTREG_URL##*/}

部署用例repo
git clone -b $JDK_BRANCH $JDK_REPO jdk-repo

执行以下命令:
cd  bin-dragonwell21/dragonwell-21.0.4.0.4+7-GA/ && export JAVA_HOME=$PWD ; export PATH=$JAVA_HOME/bin:$PATH ; export TEST_JDK_HOME=$JAVA_HOME && cd -
cd jtreg ;export JT_HOME=$PWD ; export PATH=$PWD/bin:$PATH;cd -

jtreg  -nr -v:fail,error -w tmp  -XX:+UseCompactObjectHeaders  jdk-repo/test/hotspot/jtreg/runtime/locking/TestRecursiveMonitorChurn.java

【测试分析】
x86_64,aarch64都有问题,而且是必现

【对比分析】
dragonwell21 release 同样问题
oss://dragonwell/21.0.4.0.4+7/Alibaba_Dragonwell_Extended_21.0.4.0.4.7_x64_linux.tar.gz

Temruin21 不涉及

【用例日志】

STDERR:
 stdout: [i + j = 200000

Native Memory Tracking:

Total: reserved=1612564988, committed=216459772
       malloc: 61778428 #47462
       mmap:   reserved=1550786560, committed=154681344

-                 Java Heap (reserved=104857600, committed=104857600)
                            (mmap: reserved=104857600, committed=104857600, at peak) 

-                     Class (reserved=1073832043, committed=614507)
                            (classes #682)
                            (  instance classes #581, array classes #101)
                            (malloc=90219 #1499) (peak=90299 #1500) 
                            (mmap: reserved=1073741824, committed=524288, at peak) 
                            (  Metadata:   )
                            (    reserved=67108864, committed=5111808)
                            (    used=5046912)
                            (    waste=64896 =1.27%)
                            (  Class space:)
                            (    reserved=1073741824, committed=524288)
                            (    used=419520)
                            (    waste=104768 =19.98%)

-                    Thread (reserved=15788688, committed=801424)
                            (threads #15)
                            (stack: reserved=15732736, committed=745472, peak=745472)
                            (malloc=37088 #118) (peak=45480 #122) 
                            (arena=18864 #34) (peak=154736 #28)

-                      Code (reserved=253702856, committed=7799496)
                            (malloc=70344 #1193) (peak=70392 #1194) 
                            (mmap: reserved=253632512, committed=7729152, at peak) 
                            (arena=0 #0) (peak=33712 #1)

-                        GC (reserved=84654198, committed=84654198)
                            (malloc=48986230 #902) (peak=48986262 #900) 
                            (mmap: reserved=35667968, committed=35667968, at peak) 

-                 GCCardSet (reserved=23432, committed=23432)
                            (malloc=23432 #303) (at peak) 

-                  Compiler (reserved=175232, committed=175232)
                            (malloc=5688 #52) (peak=5752 #51) 
                            (arena=169544 #6) (peak=1086912 #7)

-                  Internal (reserved=215255, committed=215255)
                            (malloc=178391 #1303) (peak=180391 #1313) 
                            (mmap: reserved=36864, committed=36864, at peak) 

-                    Symbol (reserved=2763824, committed=2763824)
                            (malloc=955152 #3319) (at peak) 
                            (arena=1808672 #1) (at peak)

-    Native Memory Tracking (reserved=768360, committed=768360)
                            (malloc=8968 #143) (peak=9320 #147) 
                            (tracking overhead=759392)

-               Arena Chunk (reserved=674536, committed=674536)
                            (malloc=674536 #118) (peak=2682944 #117) 

-                   Tracing (reserved=337, committed=337)
                            (malloc=337 #9) (at peak) 

-                Statistics (reserved=128, committed=128)
                            (malloc=128 #2) (at peak) 

-                 Arguments (reserved=171, committed=171)
                            (malloc=171 #5) (at peak) 

-                    Module (reserved=176336, committed=176336)
                            (malloc=176336 #2075) (at peak) 

-                 Safepoint (reserved=8192, committed=8192)
                            (mmap: reserved=8192, committed=8192, at peak) 

-           Synchronization (reserved=390368, committed=390368)
                            (malloc=390368 #847) (at peak) 

-            Serviceability (reserved=17152, committed=17152)
                            (malloc=17152 #9) (peak=17296 #11) 

-                 Metaspace (reserved=67122032, committed=5124976)
                            (malloc=13168 #11) (at peak) 
                            (mmap: reserved=67108864, committed=5111808, at peak) 

-      String Deduplication (reserved=680, committed=680)
                            (malloc=680 #8) (at peak) 

-           Object Monitors (reserved=7393568, committed=7393568)
                            (malloc=7393568 #35546) (at peak) 

-                   Unknown (reserved=0, committed=0)
                            (mmap: reserved=0, committed=0, peak=20480) 

];
 stderr: []
 exitValue = 0

java.lang.RuntimeException: Allocated too many monitors
    at TestRecursiveMonitorChurn.main(TestRecursiveMonitorChurn.java:87)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
    at java.base/java.lang.Thread.run(Thread.java:1583)

JavaTest Message: Test threw exception: java.lang.RuntimeException: Allocated too many monitors
JavaTest Message: shutting down test

【jdk信息】

java -version;java -Xinternalversion
openjdk version "21.0.4.0.4" 2024-10-15
OpenJDK Runtime Environment (Alibaba Dragonwell Extended Edition)-21.0.4.0.4+7-GA (build 21.0.4.0.4)
OpenJDK 64-Bit Server VM (Alibaba Dragonwell Extended Edition)-21.0.4.0.4+7-GA (build 21.0.4.0.4, mixed mode, sharing)
OpenJDK 64-Bit Server VM (21.0.4.0.4) for linux-amd64 JRE (21.0.4.0.4), built on 2024-10-15T00:00:00Z by "dragonwell" with gcc 11.2.0

【系统版本信息】

uname -a ; cat /etc/os-release ; free -h ; lscpu | head -n 25
Linux CompilerTest-x64-3 5.10.134-16.1.al8.x86_64 #1 SMP Thu Dec 7 14:11:24 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
NAME="Alibaba Cloud Linux"
VERSION="3 (Soaring Falcon)"
ID="alinux"
ID_LIKE="rhel fedora centos anolis"
VERSION_ID="3"
UPDATE_ID="9"
PLATFORM_ID="platform:al8"
PRETTY_NAME="Alibaba Cloud Linux 3 (Soaring Falcon)"
ANSI_COLOR="0;31"
HOME_URL="https://www.aliyun.com/"

              total        used        free      shared  buff/cache   available
Mem:          123Gi       1.0Gi       113Gi       2.0Mi       9.3Gi       121Gi
Swap:            0B          0B          0B
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              32
On-line CPU(s) list: 0-31
Thread(s) per core:  2
Core(s) per socket:  16
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               106
Model name:          Intel(R) Xeon(R) Platinum 8369B CPU @ 2.70GHz
Stepping:            6
CPU MHz:             3518.487
BogoMIPS:            5399.99
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           48K
L1i cache:           32K
L2 cache:            1280K
L3 cache:            49152K
NUMA node0 CPU(s):   0-31
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves wbnoinvd arat avx512vbmi pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid fsrm arch_capabilities
sendaoYan commented 5 days ago

https://code.alibaba-inc.com/os-quality/tone-matrix-compiler/codereview/18973882