[crac] RFR: Provide arguments for restore [v5]

Dan Heidinga heidinga at openjdk.java.net
Fri Mar 18 14:00:08 UTC 2022


On Thu, 17 Mar 2022 19:20:50 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> This change adds an ability to receive a new set of command-line arguments in the restored Java instance. The supplied demo code shows a faster replacement for `javac`.
>
> Anton Kozlov has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Use System class loader
>  - Make catch() preceise

src/java.base/share/classes/jdk/crac/Core.java line 171:

> 169:                     Method newMain = newMainClass.getDeclaredMethod("main",
> 170:                         String[].class);
> 171:                     newMain.setAccessible(true);

Good catch on adding the `setAccessible` call.  

Given that the VM is doing the lookup based on the command line parameters, we should be wrapping this with a `AccessController::doPrivileged` block as a SecurityManager shouldn't be able to block this accessibility request.

-------------

PR: https://git.openjdk.java.net/crac/pull/16


More information about the crac-dev mailing list