Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove System.security field and getSecurityManager calls for JDK 24 #20851

Merged
merged 4 commits into from
Jan 8, 2025

Conversation

theresa-m
Copy link
Contributor

This change removes the System.security private field from Java 24 which fixes the previously failing reflection check to System.security in test/functional/Java8andUp/src_110_up/org/openj9/test/java/lang/Test_Class.java.

For previous JDK versions System.security was included in jdk/internal/reflect/Reflection.fieldFilterMap which would cause a NoSuchFieldException to be thrown during an attempt to reflectively access System.security. In JDK 24 OpenJDK has removed the security field from the System class and from the fieldFilterMap as well. Since OpenJ9 does not need this field in JDK 24 I will remove it as well. The absence of this field will cause a NoSuchFieldException to be thrown if reflective access is attempted.

I have also removed all the calls to System.getSecurityManager from JDK 24+ in the System class since it just returns null. There are many other unnecessary calls to System.getSecurityManager throughout the code base. I will work on removing these for JDK 24 in a future pull request.

Related: #20563

runtime/vm/resolvesupport.cpp Outdated Show resolved Hide resolved
runtime/vm/createramclass.cpp Outdated Show resolved Hide resolved
runtime/vm/createramclass.cpp Outdated Show resolved Hide resolved
runtime/vm/createramclass.cpp Outdated Show resolved Hide resolved
jcl/src/java.base/share/classes/java/lang/System.java Outdated Show resolved Hide resolved
runtime/vm/createramclass.cpp Outdated Show resolved Hide resolved
runtime/vm/resolvesupport.cpp Outdated Show resolved Hide resolved
With the removal of the security manager (JEP 486) the System.security
field is not used for anything meaningful.

Signed-off-by: Theresa Mammarella <[email protected]>
These calls are not needed since System.getSecurityManager
 returns null for JDK 24+.

Signed-off-by: Theresa Mammarella <[email protected]>
Signed-off-by: Theresa Mammarella <[email protected]>
@keithc-ca
Copy link
Contributor

Jenkins test sanity amac jdk17,jdk24

@keithc-ca
Copy link
Contributor

Compiling test code failed in each job in getStringUTF8Length for jdk24 sanity.functional job; a sample:

[2025-01-08T16:35:22.576Z]     [javac] Compiling 21 source files to /Users/jenkins/workspace/Test_openjdk24_j9_sanity.functional_aarch64_mac_Personal_testList_0/aqa-tests/functional/cmdLineTests/shareClassTests/SCHelperCompatTests/bin/SportsJar
[2025-01-08T16:35:23.399Z]     [javac] Unhandled exception
[2025-01-08T16:35:23.399Z]     [javac] Type=Segmentation error vmState=0x00000000
[2025-01-08T16:35:23.399Z]     [javac] J9Generic_Signal_Number=00000018 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000002
[2025-01-08T16:35:23.399Z]     [javac] Handler1=000000010478CF14 Handler2=0000000104635E00 InaccessibleAddress=000000000007F648
[2025-01-08T16:35:23.399Z]     [javac] x0=0000000142071500 x1=000000037FD709C0 x2=0000000000000000 x3=00000001420D8490
[2025-01-08T16:35:23.399Z]     [javac] x4=0000000148E05200 x5=000000016BB757D8 x6=000000016BB757D0 x7=000000016BB757C8
[2025-01-08T16:35:23.399Z]     [javac] x8=0000000142811E20 x9=000000000007F640 x10=0000000000000001 x11=000000000000001C
[2025-01-08T16:35:23.399Z]     [javac] x12=0000000000000010 x13=0000000000000012 x14=00000002800990E8 x15=00000002800BBA38
[2025-01-08T16:35:23.399Z]     [javac] x16=000000016BB759F0 x17=0000000206D85920 x18=000000010436C008 x19=0000000142071500
[2025-01-08T16:35:23.399Z]     [javac] x20=000000037FD709C0 x21=00000001420D8490 x22=000000037FD709C0 x23=0000000148DF1400
[2025-01-08T16:35:23.399Z]     [javac] x24=0000000148DF1000 x25=0000000000000000 x26=0000000000000006 x27=000000037FD709C0
[2025-01-08T16:35:23.399Z]     [javac] x28=000000037FAA1140 x29(FP)=000000016BB757D0 x30(LR)=000000010479C530 x31(SP)=000000016BB757B0
[2025-01-08T16:35:23.399Z]     [javac] PC=00000001047C3FBC SP=000000016BB757B0
[2025-01-08T16:35:23.399Z]     [javac] v0=00000001480d2240 (f: 1208820224.000000, d: 2.719232e-314)
[2025-01-08T16:35:23.399Z]     [javac] v1=00000001420d84a1 (f: 1108182144.000000, d: 2.669511e-314)
[2025-01-08T16:35:23.399Z]     [javac] v2=00000000483c3880 (f: 1211906176.000000, d: 5.987612e-315)
[2025-01-08T16:35:23.399Z]     [javac] v3=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T16:35:23.399Z]     [javac] v4=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T16:35:23.399Z]     [javac] v5=000000003de4a63f (f: 1038394944.000000, d: 5.130353e-315)
[2025-01-08T16:35:23.399Z]     [javac] v6=94446f0194446f01 (f: 2487512832.000000, d: -4.855772e-211)
[2025-01-08T16:35:23.399Z]     [javac] v7=000e1781000e1781 (f: 923521.000000, d: 1.959708e-308)
[2025-01-08T16:35:23.399Z]     [javac] v8=000003c10000745f (f: 29791.000000, d: 2.039238e-311)
[2025-01-08T16:35:23.399Z]     [javac] v9=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T16:35:23.399Z]     [javac] v10=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T16:35:23.399Z]     [javac] v11=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T16:35:23.399Z]     [javac] v12=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T16:35:23.400Z]     [javac] v13=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T16:35:23.400Z]     [javac] v14=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T16:35:23.400Z]     [javac] v15=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T16:35:23.400Z]     [javac] v16=bfd0000000000000 (f: 0.000000, d: -2.500000e-01)
[2025-01-08T16:35:23.400Z]     [javac] v17=3fd5655555555555 (f: 1431655808.000000, d: 3.343099e-01)
[2025-01-08T16:35:23.400Z]     [javac] v18=bf70080559555555 (f: 1498764672.000000, d: -3.913899e-03)
[2025-01-08T16:35:23.400Z]     [javac] v19=3fe62e42fefa39ef (f: 4277811712.000000, d: 6.931472e-01)
[2025-01-08T16:35:23.400Z]     [javac] v20=1541b42e1670473b (f: 376457024.000000, d: 2.757149e-206)
[2025-01-08T16:35:23.400Z]     [javac] v21=126d2ba0135b086a (f: 324733024.000000, d: 6.455884e-220)
[2025-01-08T16:35:23.400Z]     [javac] v22=f823307af5fc9ac8 (f: 4126972672.000000, d: -5.068821e+270)
[2025-01-08T16:35:23.400Z]     [javac] v23=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T16:35:23.400Z]     [javac] v24=10a4d7c8128008c9 (f: 310380736.000000, d: 1.718428e-228)
[2025-01-08T16:35:23.400Z]     [javac] v25=0d27ae370f34670a (f: 255092496.000000, d: 2.709474e-245)
[2025-01-08T16:35:23.400Z]     [javac] v26=023dbb39fe3e8f61 (f: 4265512704.000000, d: 7.103281e-298)
[2025-01-08T16:35:23.400Z]     [javac] v27=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T16:35:23.400Z]     [javac] v28=18af52ee197d15b8 (f: 427627968.000000, d: 8.787983e-190)
[2025-01-08T16:35:23.400Z]     [javac] v29=0b4f8adb17303043 (f: 389034048.000000, d: 3.361155e-254)
[2025-01-08T16:35:23.400Z]     [javac] v30=6f696e2e6176616a (f: 1635148160.000000, d: 4.819476e+228)
[2025-01-08T16:35:23.400Z]     [javac] v31=437265706c654843 (f: 1818577024.000000, d: 8.284933e+16)
[2025-01-08T16:35:23.400Z]     [javac] Module=/Users/jenkins/workspace/Test_openjdk24_j9_sanity.functional_aarch64_mac_Personal_testList_0/jdkbinary/j2sdk-image/lib/default/libj9vm29.dylib
[2025-01-08T16:35:23.400Z]     [javac] Module_base_address=0000000104768000 Symbol=getStringUTF8Length
[2025-01-08T16:35:23.400Z]     [javac] Symbol_address=00000001047C3F60
[2025-01-08T16:35:23.400Z]     [javac] Target=2_90_20250109_3 (Mac OS X 13.4.1)
[2025-01-08T16:35:23.400Z]     [javac] CPU=aarch64 (8 logical CPUs) (0x400000000 RAM)
[2025-01-08T16:35:23.400Z]     [javac] ----------- Stack Backtrace -----------
[2025-01-08T16:35:23.400Z]     [javac] ---------------------------------------

I'll retry on Linux.

@keithc-ca
Copy link
Contributor

The sanity.openjdk test failures are not unexpected.

@keithc-ca
Copy link
Contributor

Jenkins test sanity.functional alinux jdk24

@keithc-ca
Copy link
Contributor

Linux at least offers a stack trace that may help:

[2025-01-08T19:18:46.674Z]     [javac] Compiling 38 source files to /home/jenkins/workspace/Test_openjdk24_j9_sanity.functional_aarch64_linux_Personal_testList_1/aqa-tests/functional/Java22andUp/bin
[2025-01-08T19:18:48.710Z]     [javac] Unhandled exception
[2025-01-08T19:18:48.710Z]     [javac] Type=Segmentation error vmState=0x00000000
[2025-01-08T19:18:48.710Z]     [javac] J9Generic_Signal_Number=00000018 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000001
[2025-01-08T19:18:48.710Z]     [javac] Handler1=0000FFFF9B165E94 Handler2=0000FFFF9B0C7C20 InaccessibleAddress=0000000000000004
[2025-01-08T19:18:48.710Z]     [javac] R0=0000000000000002 R1=0000000000000001 R2=0000000000000004 R3=00000000FFCC7ED0
[2025-01-08T19:18:48.710Z]     [javac] R4=0000FFFF94025920 R5=0000000000000001 R6=0000000000000000 R7=0000FFFF94026320
[2025-01-08T19:18:48.710Z]     [javac] R8=0000FFFF7844301C R9=0000FFFF7803BF40 R10=0000000000000020 R11=00FFFFFFFFFFFFFF
[2025-01-08T19:18:48.710Z]     [javac] R12=0000000000000010 R13=0000000000000019 R14=000000008425A2C0 R15=0000000000000000
[2025-01-08T19:18:48.710Z]     [javac] R16=0000FFFF9B72D0E0 R17=0000000000000000 R18=0000FFFF9B72F8E0 R19=000000000000D800
[2025-01-08T19:18:48.710Z]     [javac] R20=0000000000000001 R21=00000000FFCC7ED0 R22=00000000FFCC7ED0 R23=0000000000000000
[2025-01-08T19:18:48.710Z]     [javac] R24=0000FFFF99E0D120 R25=000000000000007D R26=0000FFFF00000063 R27=0000FFFF9B90BB10
[2025-01-08T19:18:48.710Z]     [javac] R28=0000000000001070 R29=0000FFFF9B72CE80 R30=0000FFFF9B176B00 R31=0000FFFF9B72CE80
[2025-01-08T19:18:48.710Z]     [javac] PC=0000FFFF9B1A6F1C SP=0000FFFF9B72CE80 PSTATE=0000000000000000
[2025-01-08T19:18:48.710Z]     [javac] V0=0000000000103240 (f: 1061440.000000, d: 5.244210e-318)
[2025-01-08T19:18:48.710Z]     [javac] V1=000000003f800000 (f: 1065353216.000000, d: 5.263544e-315)
[2025-01-08T19:18:48.710Z]     [javac] V2=0000000049bbb9a8 (f: 1237039488.000000, d: 6.111787e-315)
[2025-01-08T19:18:48.710Z]     [javac] V3=401bb9d3beb8c86b (f: 3199780864.000000, d: 6.931472e+00)
[2025-01-08T19:18:48.710Z]     [javac] V4=bfd00ea348b88334 (f: 1220051712.000000, d: -2.508934e-01)
[2025-01-08T19:18:48.710Z]     [javac] V5=3fd5575b0be00b6a (f: 199232368.000000, d: 3.334568e-01)
[2025-01-08T19:18:48.710Z]     [javac] V6=3fe62e42fefa39ef (f: 4277811712.000000, d: 6.931472e-01)
[2025-01-08T19:18:48.710Z]     [javac] V7=4024000000000000 (f: 0.000000, d: 1.000000e+01)
[2025-01-08T19:18:48.710Z]     [javac] V8=000003c10000745f (f: 29791.000000, d: 2.039238e-311)
[2025-01-08T19:18:48.710Z]     [javac] V9=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T19:18:48.710Z]     [javac] V10=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T19:18:48.710Z]     [javac] V11=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T19:18:48.710Z]     [javac] V12=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T19:18:48.710Z]     [javac] V13=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T19:18:48.710Z]     [javac] V14=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T19:18:48.710Z]     [javac] V15=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T19:18:48.710Z]     [javac] V16=401e840b4ac4e4d2 (f: 1254417664.000000, d: 7.628949e+00)
[2025-01-08T19:18:48.710Z]     [javac] V17=00000000000003e8 (f: 1000.000000, d: 4.940656e-321)
[2025-01-08T19:18:48.710Z]     [javac] V18=4000000000000000 (f: 0.000000, d: 2.000000e+00)
[2025-01-08T19:18:48.710Z]     [javac] V19=3f9eb851eb851eb8 (f: 3951369984.000000, d: 3.000000e-02)
[2025-01-08T19:18:48.710Z]     [javac] V20=3fb1eb851eb851ec (f: 515396064.000000, d: 7.000000e-02)
[2025-01-08T19:18:48.710Z]     [javac] V21=0000000000000800 (f: 2048.000000, d: 1.011846e-320)
[2025-01-08T19:18:48.710Z]     [javac] V22=3fc999999999999a (f: 2576980480.000000, d: 2.000000e-01)
[2025-01-08T19:18:48.710Z]     [javac] V23=3fa999999999999a (f: 2576980480.000000, d: 5.000000e-02)
[2025-01-08T19:18:48.710Z]     [javac] V24=3fd6666666666666 (f: 1717986944.000000, d: 3.500000e-01)
[2025-01-08T19:18:48.710Z]     [javac] V25=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T19:18:48.710Z]     [javac] V26=3fb999999999999a (f: 2576980480.000000, d: 1.000000e-01)
[2025-01-08T19:18:48.710Z]     [javac] V27=000000000000000a (f: 10.000000, d: 4.940656e-323)
[2025-01-08T19:18:48.710Z]     [javac] V28=0000000000000001 (f: 1.000000, d: 4.940656e-324)
[2025-01-08T19:18:48.710Z]     [javac] V29=0000000000000000 (f: 0.000000, d: 0.000000e+00)
[2025-01-08T19:18:48.710Z]     [javac] V30=6974752e6176616a (f: 1635148160.000000, d: 9.787117e+199)
[2025-01-08T19:18:48.710Z]     [javac] V31=0000000200010011 (f: 65553.000000, d: 4.244024e-314)
[2025-01-08T19:18:48.710Z]     [javac] Module=/home/jenkins/workspace/Test_openjdk24_j9_sanity.functional_aarch64_linux_Personal_testList_1/jdkbinary/j2sdk-image/lib/default/libj9vm29.so
[2025-01-08T19:18:48.710Z]     [javac] Module_base_address=0000FFFF9B130000
[2025-01-08T19:18:48.710Z]     [javac] Target=2_90_20250108_3 (Linux 5.15.0-122-generic)
[2025-01-08T19:18:48.710Z]     [javac] CPU=aarch64 (4 logical CPUs) (0x1ef89d000 RAM)
[2025-01-08T19:18:48.710Z]     [javac] ----------- Stack Backtrace -----------
[2025-01-08T19:18:48.710Z]     [javac] getStringUTF8Length+0xa8 (0x0000FFFF9B1A6F1C [libj9vm29.so+0x76f1c])
[2025-01-08T19:18:48.710Z]     [javac] getStringUTFChars+0x40 (0x0000FFFF9B176B00 [libj9vm29.so+0x46b00])
[2025-01-08T19:18:48.710Z]     [javac] Java_jdk_internal_loader_NativeLibrary_findEntry0+0x30 (0x0000FFFF7803BF70 [libjava.so+0xbf70])
[2025-01-08T19:18:48.710Z]     [javac]  (0x0000FFFF784430E8 [<unknown>+0x0])
[2025-01-08T19:18:48.710Z]     [javac] ---------------------------------------

@keithc-ca
Copy link
Contributor

The failure in the other job is #20835.

@keithc-ca
Copy link
Contributor

The segmentation fault problems are tracked by #20870.

Copy link
Contributor

@keithc-ca keithc-ca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new problems seen during testing.

@keithc-ca keithc-ca merged commit 08808db into eclipse-openj9:master Jan 8, 2025
7 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants