Skip to content

8382879: AOT training run exits with 0 even if assembly subprocess fails#31496

Open
iklam wants to merge 1 commit into
openjdk:masterfrom
iklam:8382879-aot-training-run-exits-with-0-even-if-assembly-subprocess-fails
Open

8382879: AOT training run exits with 0 even if assembly subprocess fails#31496
iklam wants to merge 1 commit into
openjdk:masterfrom
iklam:8382879-aot-training-run-exits-with-0-even-if-assembly-subprocess-fails

Conversation

@iklam

@iklam iklam commented Jun 12, 2026

Copy link
Copy Markdown
Member

If the sub-process that assembles the AOT cache has failed, the main JVM process that executes the training run should also exit immediately with an error code.



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 2 Reviewers)

Issue

  • JDK-8382879: AOT training run exits with 0 even if assembly subprocess fails (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31496/head:pull/31496
$ git checkout pull/31496

Update a local copy of the PR:
$ git checkout pull/31496
$ git pull https://git.openjdk.org/jdk.git pull/31496/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31496

View PR using the GUI difftool:
$ git pr show -t 31496

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31496.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jun 12, 2026

Copy link
Copy Markdown

👋 Welcome back iklam! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Jun 12, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk

openjdk Bot commented Jun 12, 2026

Copy link
Copy Markdown

@iklam The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk

openjdk Bot commented Jun 12, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot-runtime. This can be overridden with the /reviewers command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 12, 2026
@iklam

iklam commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

/reviewers 1 reviewer

@openjdk

openjdk Bot commented Jun 12, 2026

Copy link
Copy Markdown

@iklam
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 1 (with at least 1 Reviewer).

@mlbridge

mlbridge Bot commented Jun 12, 2026

Copy link
Copy Markdown

Webrevs

if (status != 0) {
log_error(aot)("Child process failed; status = %d", status);
vm_exit(status);
// We leave the temp config file for debugging

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unreachable comment. Should we move this comment line before vm_exit(status)

*/

import java.io.File;
import java.nio.file.Path;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unuse 'import java.nio.file.Path;'.


public static void main(String[] args) throws Exception {
// The main training run process should report the failure if the AOT assembly
// sub-processes has failed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

'sub-process has failed.' maybe better.

"-XX:AOTCacheOutput=" + aotCacheFile,
"-cp", appJar, helloClass);
pb.environment().put("JDK_AOT_VM_OPTIONS", "-XX:+NoSuchOption");
OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "ontstep-train");

@sendaoYan sendaoYan Jun 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe better with 'onestep-train'

out.shouldContain("Picked up JDK_AOT_VM_OPTIONS: -XX:+NoSuchOption");
out.shouldContain("Unrecognized VM option 'NoSuchOption'");
out.shouldContain("Error: Could not create the Java Virtual Machine.");
out.shouldHaveExitValue(1);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we add negative check like out.shouldNotContain("AOTCache creation is complete");

@vnkozlov vnkozlov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

May be add comment that we do this in all cases, including jcmd or AOTMXbean.

@iklam

iklam commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

/reviewers 2 reviewer

@openjdk

openjdk Bot commented Jun 12, 2026

Copy link
Copy Markdown

@iklam
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 2 Reviewers).

@johan-sjolen johan-sjolen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems fine by me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-runtime [email protected] rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

4 participants