dragonwell-releng / dragonwell-adoptium

0 stars 0 forks source link

【dragonwell8】extended tools/pack200/Pack200Test.java运行失败:memory leak detected #319

Closed owanqian closed 10 months ago

owanqian commented 10 months ago

x86: https://tone.aliyun-inc.com/ws/xesljfzh/test_result/257790 arm: https://tone.aliyun-inc.com/ws/xesljfzh/test_result/257791 【环境准备】

wget -O binary.tar.gz https://dragonwell.oss-cn-shanghai.aliyuncs.com/8.17.18-test/Alibaba_Dragonwell_Extended_8.17.18_x64_linux.tar.gz
tar xzvf binary.tar.gz
cd binary-download && export JAVA_HOME=$PWD ; export PATH=$JAVA_HOME/bin:$PATH ; export TEST_JDK_HOME=$JAVA_HOME && cd -
wget -O jtreg.zip http://114.55.64.175:8666/compiler-ci-bucket/tools/jtreg_5_1_b01.zip
unzip jtreg.zip
cd jtreg 
export JT_HOME=$PWD ; export PATH=$PWD/bin:$PATH
cd -
git clone https://github.com/dragonwell-project/dragonwell8.git -b dragonwell_extended-8.17.18 jdk-repo
test=jdk-repo/jdk/test/tools/pack200/Pack200Test.java
args="-XX:-UseCompressedOops"
jtreg -w jt-work -nr -v:fail,error $native $args $test

【对比测试】

在32xlarge的ECS下运行都是通过的. 在8xlarge的ECS下,失败. 当前测试使用的规格是8xlarge.

ajdk8 release版本 相同问题.

http://114.55.64.175:8666/ajdk-backup/8.21.25/OpenJDK8U-jdk_x64_linux_ajdk_2023-10-13-03-56.tar.gz

[root@VM20190228-137 bin]# ./java -version; ./java -Xinternalversion
openjdk version "1.8.0_382"
OpenJDK Runtime Environment (Alibaba 8.21.25) (build 1.8.0_382-b784)
OpenJDK 64-Bit Server VM (Alibaba 8.21.25) (build 25.382-b784, mixed mode)
OpenJDK 64-Bit Server VM (25.382-b784) for linux-amd64 JRE (1.8.0_382-b784), built on Oct 13 2023 04:00:41 by "root" with gcc 4.8.2 20140120 (Red Hat 4.8.2-15)

dragonwell8 release版本 相同问题. https://github.com/dragonwell-project/dragonwell8/releases/download/dragonwell-standard-8.16.17_jdk8u382-ga/Alibaba_Dragonwell_Standard_8.16.17_x64_linux.tar.gz

[root@VM20190228-137 bin]# ./java -version; ./java -Xinternalversion
openjdk version "1.8.0_382"
OpenJDK Runtime Environment (Alibaba Dragonwell Extended Edition 8.16.17) (build 1.8.0_382-b01)
OpenJDK 64-Bit Server VM (Alibaba Dragonwell Extended Edition 8.16.17) (build 25.382-b01, mixed mode)
OpenJDK 64-Bit Server VM (25.382-b01) for linux-amd64 JRE (1.8.0_382-b01), built on Aug  4 2023 07:24:01 by "jenkins" with gcc 7.5.0

temurin8 release 相同问题. https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u382-b05/OpenJDK8U-jdk_x64_linux_hotspot_8u382b05.tar.gz

[root@VM20190228-137 bin]# ./java -version; ./java -Xinternalversion
d -
openjdk version "1.8.0_382"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_382-b05)
OpenJDK 64-Bit Server VM (Temurin)(build 25.382-b05, mixed mode)
OpenJDK 64-Bit Server VM (25.382-b05) for linux-amd64 JRE (1.8.0_382-b05), built on Jul 19 2023 15:36:27 by "jenkins" with gcc 7.5.0

【用例日志】

STDOUT:
[/disk1/d8/dragonwell-8.16.17/lib/tools.jar, /disk1/d8/dragonwell-8.16.17/jre/lib/rt.jar, /disk1/d8/jdk-repo/jdk/test/tools/pack200/pack200-verifier/data/golden.jar]
Packing [/disk1/d8/dragonwell-8.16.17/lib/tools.jar]
  Info: memory diff = -662K
  Unpacking using java unpacker
  Testing...java unpacker
  Info: memory diff = 1250K
added manifest
adding: sun/(in = 0) (out= 0)(stored 0%)
adding: sun/tools/(in = 0) (out= 0)(stored 0%)
adding: sun/tools/pack/(in = 0) (out= 0)(stored 0%)
adding: sun/tools/pack/verify/(in = 0) (out= 0)(stored 0%)
adding: sun/tools/pack/verify/VerifyTreeSet.class(in = 636) (out= 373)(deflated 41%)
adding: sun/tools/pack/verify/Globals.class(in = 7414) (out= 3696)(deflated 50%)
adding: sun/tools/pack/verify/Main.class(in = 3930) (out= 2074)(deflated 47%)
adding: sun/tools/pack/verify/JarFileCompare.class(in = 4989) (out= 2625)(deflated 47%)
adding: sun/tools/pack/verify/ClassCompare.class(in = 4415) (out= 2170)(deflated 50%)
adding: xmlkit/(in = 0) (out= 0)(stored 0%)
adding: xmlkit/AttributeVisitor$1.class(in = 2040) (out= 1005)(deflated 50%)
adding: xmlkit/AnnotationsElementVisitor.class(in = 4512) (out= 1503)(deflated 66%)
adding: xmlkit/XMLKit$11.class(in = 1003) (out= 532)(deflated 46%)
adding: xmlkit/XMLKit$Builder.class(in = 5465) (out= 2908)(deflated 46%)
adding: xmlkit/XMLKit$6.class(in = 860) (out= 461)(deflated 46%)
adding: xmlkit/XMLKit$Element$1.class(in = 760) (out= 431)(deflated 43%)
adding: xmlkit/XMLKit$Special.class(in = 1688) (out= 869)(deflated 48%)
adding: xmlkit/InstructionVisitor.class(in = 5442) (out= 2004)(deflated 63%)
adding: xmlkit/XMLKit$5.class(in = 541) (out= 336)(deflated 37%)
adding: xmlkit/XMLKit$Element$ElemW.class(in = 1990) (out= 1043)(deflated 47%)
adding: xmlkit/XMLKit.class(in = 18836) (out= 8729)(deflated 53%)
adding: xmlkit/StackMapVisitor.class(in = 7288) (out= 2364)(deflated 67%)
adding: xmlkit/XMLKit$1MFilt.class(in = 2456) (out= 1303)(deflated 46%)
adding: xmlkit/XMLKit$Element$1ESet.class(in = 1034) (out= 538)(deflated 47%)
adding: xmlkit/XMLKit$Element.class(in = 33332) (out= 15215)(deflated 54%)
adding: xmlkit/TokenList.class(in = 6982) (out= 3451)(deflated 50%)
adding: xmlkit/XMLKit$Element$LView.class(in = 1902) (out= 836)(deflated 56%)
adding: xmlkit/CommandLineParser.class(in = 5317) (out= 2942)(deflated 44%)
adding: xmlkit/AttributeVisitor.class(in = 25602) (out= 8022)(deflated 68%)
adding: xmlkit/XMLKit$9.class(in = 896) (out= 529)(deflated 40%)
adding: xmlkit/XMLKit$1.class(in = 1020) (out= 558)(deflated 45%)
adding: xmlkit/XMLKit$12.class(in = 993) (out= 554)(deflated 44%)
adding: xmlkit/XMLKit$Element$1Entry.class(in = 1870) (out= 975)(deflated 47%)
adding: xmlkit/XMLKit$2.class(in = 1122) (out= 603)(deflated 46%)
adding: xmlkit/XMLKit$13.class(in = 1114) (out= 621)(deflated 44%)
adding: xmlkit/XMLKit$3.class(in = 991) (out= 534)(deflated 46%)
adding: xmlkit/XMLKit$Element$1EIter.class(in = 1228) (out= 637)(deflated 48%)
adding: xmlkit/XMLKit$ElementFilter.class(in = 709) (out= 405)(deflated 42%)
adding: xmlkit/XMLKit$Element$ANItr.class(in = 1604) (out= 898)(deflated 44%)
adding: xmlkit/ConstantPoolVisitor.class(in = 13313) (out= 4138)(deflated 68%)
adding: xmlkit/XMLKit$Element$1AView.class(in = 1701) (out= 786)(deflated 53%)
adding: xmlkit/XMLKit$Filter.class(in = 224) (out= 158)(deflated 29%)
adding: xmlkit/XMLKit$14.class(in = 755) (out= 461)(deflated 38%)
adding: xmlkit/XMLKit$Outputter.class(in = 2207) (out= 1206)(deflated 45%)
adding: xmlkit/XMLKit$4.class(in = 933) (out= 546)(deflated 41%)
adding: xmlkit/XMLKit$10.class(in = 906) (out= 537)(deflated 40%)
adding: xmlkit/XMLKit$Printer.class(in = 3232) (out= 1913)(deflated 40%)
adding: xmlkit/ClassReader.class(in = 15838) (out= 7547)(deflated 52%)
adding: xmlkit/XMLKit$AttrFilter.class(in = 1030) (out= 567)(deflated 44%)
adding: xmlkit/XMLKit$Element$Itr.class(in = 1959) (out= 1032)(deflated 47%)
adding: xmlkit/XMLKit$7.class(in = 903) (out= 503)(deflated 44%)
adding: xmlkit/XMLKit$ContentComparator.class(in = 1115) (out= 635)(deflated 43%)
adding: xmlkit/XMLKit$8.class(in = 899) (out= 532)(deflated 40%)
--listing /disk1/d8/tmp/scratch/.---
- pack200-verifier.jar
- java-tools.jar
d xclasses
- tools.jar.pack
/disk1/d8/dragonwell-8.16.17/jre/bin/java -cp /disk1/d8/dragonwell-8.16.17/lib/tools.jar:pack200-verifier.jar sun.tools.pack.verify.Main /disk1/d8/dragonwell-8.16.17/lib/tools.jar /disk1/d8/tmp/scratch/java-tools.jar -O
LogFile:./verifier.log
Reference JAR:/disk1/d8/dragonwell-8.16.17/lib/tools.jar
Compared  JAR:/disk1/d8/tmp/scratch/java-tools.jar
PASS
  Unpacking using native unpacker
  Testing...native unpacker
  Info: memory diff = 11618K
--listing /disk1/d8/tmp/scratch/.---
- pack200-verifier.jar
- java-tools.jar
d xclasses
- verifier.log
- native-tools.jar
- tools.jar.pack
/disk1/d8/dragonwell-8.16.17/jre/bin/java -cp /disk1/d8/dragonwell-8.16.17/lib/tools.jar:pack200-verifier.jar sun.tools.pack.verify.Main java-tools.jar native-tools.jar -O -b
LogFile:./verifier.log
Reference JAR:/disk1/d8/tmp/scratch/java-tools.jar
Compared  JAR:/disk1/d8/tmp/scratch/native-tools.jar
PASS
Done.
Packing [/disk1/d8/dragonwell-8.16.17/jre/lib/rt.jar]
  Info: memory diff = 7694K
  Unpacking using java unpacker
  Testing...java unpacker
  Info: memory diff = 15271K
--listing /disk1/d8/tmp/scratch/.---
- java-rt.jar
- pack200-verifier.jar
- java-tools.jar
- rt.jar.pack
d xclasses
- verifier.log
- native-tools.jar
- tools.jar.pack
/disk1/d8/dragonwell-8.16.17/jre/bin/java -cp /disk1/d8/dragonwell-8.16.17/lib/tools.jar:pack200-verifier.jar sun.tools.pack.verify.Main /disk1/d8/dragonwell-8.16.17/jre/lib/rt.jar /disk1/d8/tmp/scratch/java-rt.jar -O
LogFile:./verifier.log
Reference JAR:/disk1/d8/dragonwell-8.16.17/jre/lib/rt.jar
Compared  JAR:/disk1/d8/tmp/scratch/java-rt.jar
PASS
  Unpacking using native unpacker
  Testing...native unpacker
  Info: memory diff = 22397K
STDERR:
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
java.lang.RuntimeException: java.lang.Exception: memory leak detected 22397
        at Pack200Test.doPackUnpack(Pack200Test.java:114)
        at Pack200Test.main(Pack200Test.java:134)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
        at java.lang.Thread.run(Thread.java:855)
Caused by: java.lang.Exception: memory leak detected 22397
        at Pack200Test.leakCheck(Pack200Test.java:66)
        at Pack200Test.doPackUnpack(Pack200Test.java:107)
        ... 7 more

JavaTest Message: Test threw exception: java.lang.RuntimeException: java.lang.Exception: memory leak detected 22397
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.RuntimeException: java.lang.Exception: memory leak detected 22397

【版本信息】

[root@VM20190228-137 d8]# uname -a ; cat /etc/os-release ; free -h; lscpu| head -n 25;java -version; java -Xinternalversion
Linux VM20190228-137 5.10.134-14.al8.x86_64 #1 SMP Thu Apr 27 16:46:29 CST 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"
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:           15Gi       765Mi       2.0Gi       842Mi        12Gi        13Gi
Swap:            0B          0B          0B
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  2
Core(s) per socket:  1
Socket(s):           2
NUMA node(s):        1
Vendor ID:           GenuineIntel
BIOS Vendor ID:      Alibaba Cloud
CPU family:          6
Model:               85
Model name:          Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz
BIOS Model name:     pc-i440fx-2.1
Stepping:            4
CPU MHz:             2500.012
BogoMIPS:            5000.02
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            1024K
L3 cache:            33792K
NUMA node0 CPU(s):   0-3
openjdk version "1.8.0_382"
OpenJDK Runtime Environment (Alibaba Dragonwell Extended Edition 8.16.17) (build 1.8.0_382-b01)
OpenJDK 64-Bit Server VM (Alibaba Dragonwell Extended Edition 8.16.17) (build 25.382-b01, mixed mode)
OpenJDK 64-Bit Server VM (25.382-b01) for linux-amd64 JRE (1.8.0_382-b01), built on Dec 14 2023 04:53:28 by "root" with gcc 7.5.0
sendaoYan commented 10 months ago

https://github.com/dragonwell-project/dragonwell8/issues/608 在这跟踪

sendaoYan commented 10 months ago

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