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

Replace SecurityManager use with Java agent #143

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

theresa-m
Copy link
Contributor

Starting in Java 24 the SecurityManager will be removed from the JDK. Load tests rely on the SecurityManager to intercept calls to System.exit and replace them with an exception to avoid shutting down before all the tests have run. I replaced this with a Java agent that uses ASM to rewrite System.exit calls to throw an exception instead. This change also works for previous Java versions.

This change also updates the ASM library version from 9.0 to 9.7.1 to include Java 24 support. It also adds the asm-commons library as a dependency which is needed to use the org.objectweb.asm.commons.LocalVariablesSorter library.

To validate my changes I ran sanity and extended system tests with OpenJ9 for Java 11 and 24 including the tests that were disabled in adoptium/aqa-tests#5817. In Java 24 there are a few remaining failures related to SecurityManger use in mauve tests that are not related to this change.

As a next step I will be re-enabling the tests that can be run in Java 24.

Fixes: #142

Starting in Java 24 the SecurityManager will be removed from the JDK.
Load tests rely on the SecurityManager to intercept calls to
System.exit and replace them with an exception to avoid
shutting down before all the tests have run. I replaced this with a Java agent
that uses ASM to rewrite System.exit calls to throw an exception instead.
This change also works for previous Java versions.

This change also updates the ASM library version from 9.0 to 9.7.1 to include
Java 24 support. It also adds the asm-commons library as a dependency which is
needed to use the org.objectweb.asm.commons.LocalVariablesSorter library.

Signed-off-by: Theresa Mammarella <Theresa.T.Mammarella@ibm.com>
@karianna karianna merged commit e852ffe into adoptium:master Jan 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove reliance on SecurityManager for Java 24
2 participants