dragonwell-project / dragonwell11

Alibaba Dragonwell11 JDK
https://www.aliyun.com/product/dragonwell
GNU General Public License v2.0
561 stars 115 forks source link

[dragonwell11][ajdk11][nightly]com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java用例失败:java.lang.ExceptionInInitializerError #879

Open sendaoYan opened 3 weeks ago

sendaoYan commented 3 weeks ago

任务链接:https://tone.aliyun-inc.com/ws/xesljfzh/test_result/393356

【环境准备】

BINARY_URL=oss://compiler-ci-bucket/dragonwell11/CI/tar/20241022-003915-906-#540-linux.x86_64.release.master-85a2ef00c6a56061c776195746bc1baa0479ad34.jdk.tar.gz
TEST_IMAGE=oss://compiler-ci-bucket/dragonwell11/CI/tar/20241022-003915-906-#540-linux.x86_64.release.master-85a2ef00c6a56061c776195746bc1baa0479ad34.test-image.tar.gz
JDK_REPO=git@github.com:dragonwell-project/dragonwell11.git
JDK_BRANCH=master

jtreg=oss://compiler-ci-bucket/jdk/tools/jtreg-7.4.1.zip

#下载解压jtreg,cd jtreg并配置
export JT_HOME=$PWD ; export PATH=$PWD/bin:$PATH
#下载解压jdk,cd <目录>并配置
export JAVA_HOME=$PWD ; export PATH=$JAVA_HOME/bin:$PATH ; export TEST_JDK_HOME=$JAVA_HOME
#下载jdk-repo
git clone https://${JDK_REPO} --depth 1 -b $JDK_BRANCH jdk-repo

#执行测试
jtreg -w tmp -nr -v:fail,error  com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java

【测试分析】

com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java
x86-64、arm上都存在。
ajdk11 nightly也存在:
BINARY_URL=oss://compiler-ci-bucket/ajdk11/CI/tar/20241011-004612-945-#827-linux.x86_64.release.master-e0d2c945e037eaa4449d58c8415153a2088885b2.jdk.tar.gz

release版本和上游都是pass的
https://dragonwell.oss-cn-shanghai.aliyuncs.com/11.0.24.21.8/Alibaba_Dragonwell_Extended_11.0.24.21.8_x64_linux.tar.gz

【版本信息】

jdk信息

[root@iZbp14ilm555un94k5sfbiZ j2sdk-image]# bin/java -version; bin/java -Xinternalversion
openjdk version "11.0.24-internal" 2024-07-16
OpenJDK Runtime Environment (build 11.0.24-internal+0-adhoc..dragonwell11.nightly.pipeline)
OpenJDK 64-Bit Server VM (build 11.0.24-internal+0-adhoc..dragonwell11.nightly.pipeline, mixed mode)
OpenJDK 64-Bit Server VM (11.0.24-internal+0-adhoc..dragonwell11.nightly.pipeline) for linux-amd64 JRE (11.0.24-internal+0-adhoc..dragonwell11.nightly.pipeline), built on Oct 21 2024 16:40:06 by "" with gcc 7.5.0

测试机信息jdk环境信息

[root@iZbp14ilm555un94k5sfbiZ jtreg]# uname -a ; cat /etc/os-release ; free -h; lscpu| head -n 25; dmidecode -t chassis
Linux iZbp14ilm555un94k5sfbiZ 5.10.134-17.2.al8.x86_64 #1 SMP Fri Aug 9 15:49:42 CST 2024 x86_64 x86_64 x86_64 GNU/Linux
NAME="Alibaba Cloud Linux"
VERSION="3 (OpenAnolis Edition)"
ID="alinux"
ID_LIKE="rhel fedora centos anolis"
VERSION_ID="3"
VARIANT="OpenAnolis Edition"
VARIANT_ID="openanolis"
ALINUX_MINOR_ID="2104"
ALINUX_UPDATE_ID="10"
PLATFORM_ID="platform:al8"
PRETTY_NAME="Alibaba Cloud Linux 3.2104 U10 (OpenAnolis Edition)"
ANSI_COLOR="0;31"
HOME_URL="https://www.aliyun.com/"
              total        used        free      shared  buff/cache   available
Mem:          247Gi       810Mi       243Gi       2.0Mi       2.6Gi       244Gi
Swap:            0B          0B          0B
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              64
On-line CPU(s) list: 0-63
Thread(s) per core:  2
Core(s) per socket:  32
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
BIOS Vendor ID:      Alibaba Cloud
CPU family:          6
Model:               106
Model name:          Intel(R) Xeon(R) Platinum 8369B CPU @ 2.70GHz
BIOS Model name:     pc-i440fx-2.1
Stepping:            6
CPU MHz:             2699.998
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-63
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 2.8 present.

Handle 0x0300, DMI type 3, 21 bytes
Chassis Information
        Manufacturer: Alibaba Cloud
        Type: Other
        Lock: Not Present
        Version: pc-i440fx-2.1
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Boot-up State: Safe
        Power Supply State: Safe
        Thermal State: Safe
        Security Status: Unknown
        OEM Information: 0x00000000
        Height: Unspecified
        Number Of Power Cords: Unspecified
        Contained Elements: 0

【用例日志】

STDERR:
Note: /tmp/tone/run/jtreg/jdk-repo/test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

ACTION: main -- Failed. Execution failed: `main' threw exception: javax.management.RuntimeErrorException: java.lang.ExceptionInInitializerError
REASON: User specified action: run main/othervm DcmdMBeanPermissionsTest
TIME:   0.279 seconds
messages:
command: main DcmdMBeanPermissionsTest
reason: User specified action: run main/othervm DcmdMBeanPermissionsTest
started: Mon Oct 28 11:15:55 CST 2024
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules java.logging,java.management
finished: Mon Oct 28 11:15:56 CST 2024
elapsed time (seconds): 0.279
configuration:
Boot Layer
  add modules: java.logging java.management

STDOUT:
Testing compilerCodeHeapAnalytics
Testing compilerCodecache
Testing compilerCodelist
Testing compilerDirectivesAdd
Testing compilerDirectivesClear
Testing compilerDirectivesPrint
Testing compilerDirectivesRemove
Testing compilerPerfmap
Testing compilerQueue
Testing gcClassHistogram
Testing gcClassStats
Testing gcFinalizerInfo
Testing gcHeapInfo
Testing gcRun
Testing gcRunFinalization
Testing help
Testing jdkCheckpoint
STDERR:
javax.management.RuntimeErrorException: java.lang.ExceptionInInitializerError
        at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:831)
        at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:842)
        at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:811)
        at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
        at DcmdMBeanPermissionsTest.invokeOperation(DcmdMBeanPermissionsTest.java:143)
        at DcmdMBeanPermissionsTest.testOperation(DcmdMBeanPermissionsTest.java:171)
        at DcmdMBeanPermissionsTest.main(DcmdMBeanPermissionsTest.java:241)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
        at java.base/java.lang.Thread.run(Thread.java:955)
Caused by: java.lang.ExceptionInInitializerError
        at java.base/jdk.crac.Core.checkpointRestore(Core.java:273)
        at java.base/jdk.crac.Core.checkpointRestoreInternal(Core.java:287)
        at jdk.management/com.sun.management.internal.DiagnosticCommandImpl.executeDiagnosticCommand(Native Method)
        at jdk.management/com.sun.management.internal.DiagnosticCommandImpl$Wrapper.execute(DiagnosticCommandImpl.java:159)
        at jdk.management/com.sun.management.internal.DiagnosticCommandImpl.invoke(DiagnosticCommandImpl.java:256)
        at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809)
        ... 10 more
Caused by: java.lang.SecurityException: ("java.util.PropertyPermission" "jdk.crac.trace-startup-time" "read")
        at DcmdMBeanPermissionsTest$CustomSecurityManager.checkPermission(DcmdMBeanPermissionsTest.java:93)
        at java.base/java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1066)
        at java.base/java.lang.System.getProperty(System.java:833)
        at java.base/java.lang.Boolean.getBoolean(Boolean.java:265)
        at java.base/sun.security.action.GetBooleanAction.run(GetBooleanAction.java:71)
        at java.base/sun.security.action.GetBooleanAction.run(GetBooleanAction.java:50)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/sun.security.action.GetBooleanAction.privilegedGetProperty(GetBooleanAction.java:91)
        at java.base/jdk.crac.Core$FlagsHolder.<clinit>(Core.java:70)
        ... 16 more

JavaTest Message: Test threw exception: javax.management.RuntimeErrorException: java.lang.ExceptionInInitializerError
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: javax.management.RuntimeErrorException: java.lang.ExceptionInInitializerError
rerun:
cd /tmp/tone/run/jtreg/tmp/scratch && \
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus \
DISPLAY=localhost:10.0 \
HOME=/root \
LANG=en_US.UTF-8 \
PATH=/bin:/usr/bin:/usr/sbin \
XDG_RUNTIME_DIR=/run/user/0 \
XDG_SESSION_ID=4 \
CLASSPATH=/tmp/tone/run/jtreg/tmp/classes/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.d:/tmp/tone/run/jtreg/jdk-repo/test/jdk/com/sun/management/DiagnosticCommandMBean:/root/jtreg/lib/javatest.jar:/root/jtreg/lib/jtreg.jar \
    /tmp/tone/run/jtreg/binary-download/j2sdk-image/bin/java \
        -Dtest.vm.opts= \
        -Dtest.tool.vm.opts= \
        -Dtest.compiler.opts= \
        -Dtest.java.opts= \
        -Dtest.jdk=/tmp/tone/run/jtreg/binary-download/j2sdk-image \
        -Dcompile.jdk=/tmp/tone/run/jtreg/binary-download/j2sdk-image \
        -Dtest.timeout.factor=4.0 \
        -Dtest.root=/tmp/tone/run/jtreg/jdk-repo/test/jdk \
        -Dtest.name=com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java \
        -Dtest.file=/tmp/tone/run/jtreg/jdk-repo/test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java \
        -Dtest.src=/tmp/tone/run/jtreg/jdk-repo/test/jdk/com/sun/management/DiagnosticCommandMBean \
        -Dtest.src.path=/tmp/tone/run/jtreg/jdk-repo/test/jdk/com/sun/management/DiagnosticCommandMBean \
        -Dtest.classes=/tmp/tone/run/jtreg/tmp/classes/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.d \
        -Dtest.class.path=/tmp/tone/run/jtreg/tmp/classes/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.d \
        -Dtest.modules='java.logging java.management' \
        --add-modules java.logging,java.management \
        com.sun.javatest.regtest.agent.MainWrapper /tmp/tone/run/jtreg/tmp/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.d/main.0.jta

TEST RESULT: Failed. Execution failed: `main' threw exception: javax.management.RuntimeErrorException: java.lang.ExceptionInInitializerError
sendaoYan commented 3 weeks ago

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

lingjun-cg commented 2 weeks ago

CRaC需要调用用户的代码,无法确定需要的permission,建议与以前保持一致,屏蔽此测试用例