Unable to create snapshots with Java modules

Nikola Grcevski grcevski at gmail.com
Tue Nov 29 16:24:31 UTC 2022

Great, thanks!

I started looking at it as well, I added

_java_module_path = new SystemProperty("jdk.module.path", "", true);

and in os_linux.cpp
do_classpaths(mark_classpath_entry, &fds, Arguments::get_appmodulepath());

I was able to make things work if I put the expanded module path directly e.g:
--module-path lib/simplemodule-1.0-SNAPSHOT.jar

I'm not sure if there's a helper to expand the module path fully with
directories, when I tried
to create a mark function that handles both directories and files, the
directory scan
and mark never matches on my app lib directory on this check:

if (dent->d_ino == fstat->st_ino)

in os_linux::static void mark_all_in(FdsInfo *fds, char* dirpath).

Thanks so much for your help.

On Tue, Nov 29, 2022 at 11:11 AM Anton Kozlov <akozlov at azul.com> wrote:
> On 11/29/22 00:04, Nikola Grcevski wrote:
> > However, if I try the same thing with the modules usage, the snapshot
> > creation fails:
> > ~/work/simplemodule$ /<path>/openjdk-17-crac+3_linux-x64/bin/java
> > -XX:CRaCCheckpointTo=/tmp/simple --module-path lib --module
> > simplemodule/co.elastic.simple.SimpleModule
> Hi Nikola,
> I've reproduced the problem. It seems JDK misses a piece of code for modules that is there for class loaders. It looks easy to fix, I'm looking at this.
> Meanwhile, while you're experimenting, you may disable CheckpointException by -XX:+UnlockExperimentalVMOptions -XX:-CRDoThrowCheckpointException. Of course, it's not recommended for anything beyond experiments :)
> Thanks,
> Anton

More information about the crac-dev mailing list