openj9
openj9 copied to clipboard
RCP: pingLiberty server failed to startup in restore mode with -Xgcpolicy:balanced
The server program pingLiberty failed to startup in restore mode when -Xgcpolicy:balanced is used. The GC detects a class loader object field is NULL, see the detail error message below,
Launching defaultServer (Open Liberty 25.0.0.5/wlp-1.0.101.cl250520250504-1901) on Eclipse OpenJ9 VM, version 11.0.28-internal+0-adhoc.lzhou.openj9-openjdk-jdk11 (en_CA) 21:02:58.525 0x642d700 j9mm.107 * ** ASSERTION FAILED ** at /home/lzhou/ramclass/openj9-openjdk-jdk11/openj9/runtime/gc_vlhgc/WriteOnceCompactor.cpp:1785: ((false && ((classLoader == _javaVM->systemClassLoader) || (classLoader == _javaVM->applicationClassLoader) || (classLoader == _javaVM->extensionClassLoader)))) JVMDUMP039I Processing dump event "traceassert", detail "" at 2025/06/11 17:02:58 - please wait.
@babsingh @TobiAjila, it happens only with -Xgcpolicy:balanced
From the preliminary investigation of issue, it appears the loader is application class loader from snapshot. In restore run, a new application class loader is allocated. It looks like it doesn't cause other issues, from my testing using pingLibery server program, maybe GC can just ignore it like frozen class case, a simple fix.
@tajila The assumption that J9ClassLoader->classLoaderObject is always initialized before the first GC does not hold true when using -Xgcpolicy:balanced. Should we continue development using other GC policies and set aside the -Xgcpolicy:balanced specific issue for now?
@tajila The assumption that
J9ClassLoader->classLoaderObjectis always initialized before the first GC does not hold true when using-Xgcpolicy:balanced. Should we continue development using other GC policies and set aside the-Xgcpolicy:balancedspecific issue for now?
I found the dead codes https://github.com/eclipse-openj9/openj9/blob/f255919f1f639eb4b64238b12e5fcd5e03320565/runtime/jcl/common/stdinit.c#L468
RCP saves only three class loaders, the application class loader is one of them. Is it possible to use the persistent class loader? Or there is limitation, the codes should be cleaned.