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

Handle potentially null moduleName in restoreModule #20871

Open
ThanHenderson opened this issue Dec 30, 2024 · 0 comments
Open

Handle potentially null moduleName in restoreModule #20871

ThanHenderson opened this issue Dec 30, 2024 · 0 comments

Comments

@ThanHenderson
Copy link
Contributor

ThanHenderson commented Dec 30, 2024

When VM snapshotting is enabled, restore runs need to restore snapshotted modules.

The restoration procedure in java11vmi.c::restoreModule loops over all classes loaded from the persisted systemClassLoader, then performs a string compare to identify whether a classes module is the java.base module.

There is an issue that I've seen in JDK21 (but likely affects other versions too), that a clazz->module->moduleName is null, but this case isn't handled (results in a seg fault here).

Unnamed module's module names are set to NULL [1, 2], so if the walker over classes from systemClassLoader returns a class whose module is an unnamed module, the problematic code path will result in a failure.

@ThanHenderson ThanHenderson closed this as not planned Won't fix, can't repro, duplicate, stale Dec 30, 2024
@ThanHenderson ThanHenderson reopened this Dec 30, 2024
@ThanHenderson ThanHenderson changed the title Handle potentially null clazzModule->:wmoduleName in restoreModule Handle potentially null moduleName in restoreModule Dec 30, 2024
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

No branches or pull requests

1 participant