Skip to content

8359423: Improve error message in case of missing jsa shared archive #25846

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MBaesken
Copy link
Member

@MBaesken MBaesken commented Jun 17, 2025

In case we use -Xshare:on with additional flags (regarding coh or coops) and we have the corresponding jsa archive not present,
we get this message/error :

Error occurred during initialization of VM
Unable to use shared archive.

The error message could be a little improved, e.g. telling what jsa file is not present .
For example

./images/jdk/bin/java -Xshare:on -version
[0.017s][error][aot] Opening of static archive /build_linux/images/jdk/lib/server/classes.jsa failed
Error occurred during initialization of VM
Unable to use shared archive (unrecoverable archive loading error).

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8359423: Improve error message in case of missing jsa shared archive (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25846

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 17, 2025

👋 Welcome back mbaesken! 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
Copy link

openjdk bot commented Jun 17, 2025

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

@openjdk openjdk bot changed the title JDK-8359423: Improve error message in case of missing jsa shared archive 8359423: Improve error message in case of missing jsa shared archive Jun 17, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 17, 2025
@openjdk
Copy link

openjdk bot commented Jun 17, 2025

@MBaesken 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 added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Jun 17, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 17, 2025

Webrevs

@@ -1385,7 +1385,7 @@ void MetaspaceShared::initialize_runtime_shared_and_meta_spaces() {
delete dynamic_mapinfo;
}
if (RequireSharedSpaces && has_failed) {
MetaspaceShared::unrecoverable_loading_error("Unable to map shared spaces");
MetaspaceShared::unrecoverable_loading_error("Unable to map shared spaces, but they were required");
Copy link
Member

Choose a reason for hiding this comment

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

If you want the message to be more specific, you might need to add whether the failed loading was dynamic or static.

@@ -1271,7 +1271,7 @@ void MetaspaceShared::unrecoverable_loading_error(const char* message) {
} else if (CDSConfig::new_aot_flags_used()) {
vm_exit_during_initialization("Unable to use AOT cache.", nullptr);
} else {
vm_exit_during_initialization("Unable to use shared archive.", nullptr);
vm_exit_during_initialization("Unable to use shared archive (unrecoverable archive loading error).", nullptr);
Copy link
Member

Choose a reason for hiding this comment

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

Who not to use message here instead of 'unrecoverable archive loading error'? The default message is 'unrecoverable error'. The default message can be updated to 'unrecoverable archive loading error'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants