openj9 icon indicating copy to clipboard operation
openj9 copied to clipboard

RCP: pingLiberty server failed to startup in restore mode with -Xgcpolicy:balanced

Open lzhou2025 opened this issue 5 months ago • 5 comments

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.

lzhou2025 avatar Jun 11 '25 21:06 lzhou2025

@babsingh @TobiAjila, it happens only with -Xgcpolicy:balanced

lzhou2025 avatar Jun 11 '25 21:06 lzhou2025

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.

lzhou2025 avatar Jun 12 '25 22:06 lzhou2025

@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?

babsingh avatar Jun 13 '25 16:06 babsingh

@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?

I found the dead codes https://github.com/eclipse-openj9/openj9/blob/f255919f1f639eb4b64238b12e5fcd5e03320565/runtime/jcl/common/stdinit.c#L468

lzhou2025 avatar Jun 16 '25 16:06 lzhou2025

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.

lzhou2025 avatar Jun 16 '25 17:06 lzhou2025