RFR: 8356324: JVM crash (SIGSEGV at ClassListParser::resolve_indy_impl) during -Xshare:dump starting from 21.0.5

Matias Saavedra Silva matsaave at openjdk.org
Tue Aug 19 20:59:35 UTC 2025


On Thu, 14 Aug 2025 07:30:40 GMT, Koichi Sakata <ksakata at openjdk.org> wrote:

> A crash occurs when running with `-Xshare:dump` and specifying a class list file generated by an older JDK (e.g. JDK 17) via `-XX:SharedClassListFile`.
> This pull request fixes the issue and prevents the crash.
> 
> # Details
> Example command to reproduce:
> 
> $ ./jdk-26/fastdebug/bin/java -Xshare:dump -XX:SharedClassListFile=classes.list -XX:SharedArchiveFile=noop.jsa HelloWorld              
> #                                                                                                                                                              
> # A fatal error has been detected by the Java Runtime Environment:                                                                                             
> #                                                                                                                                                              
> #  SIGSEGV (0xb) at pc=0x0000ffff8610355c, pid=53155, tid=53156                                                                                                
> #                                                                                                                                                              
> # JRE version: OpenJDK Runtime Environment (26.0) (fastdebug build 26-internal-adhoc.jyukutyo.jyukutyo-jdk)                                                    
> # Java VM: OpenJDK 64-Bit Server VM (fastdebug 26-internal-adhoc.jyukutyo.jyukutyo-jdk, interpreted mode, compressed oops, compressed class ptrs, g1 gc, linux-
> aarch64)                                                                                                                                                       
> # Problematic frame:                                                                                                                                           
> # V  [libjvm.so+0x90355c]  ClassListParser::resolve_indy_impl(Symbol*, JavaThread*)+0x2dc 
> [full crash log omitted for brevity]
> 
> The class list file that triggers the problem, generated by JDK 17, looks like this:
> 
> @lambda-proxy java/lang/System$LoggerFinder run ()Ljava/security/PrivilegedAction; ()Ljava/lang/Object; REF_invokeStatic java/lang/System$LoggerFinder lambda$accessProvider$0 ()Ljava/lang/System$LoggerFinder; ()Ljava/lang/System$LoggerFinder;
> 
> 
> In contrast, the recent JDK generates class list contents as follows:
> 
> @cp jdk/internal/logger/LoggerFinderLoader 15 21 30 96 99 105 110 117 118 122 141
> @cp jdk/internal/logger/DefaultLoggerFinder 1 2 7 8 14 22 2...

I believe the constant pool cache refactor was introduced in JDK 21 which explains why older classlist files may cause some trouble. The fix looks good and I believe it should be sufficient as we don't tend to call `resolved_indy_entry_at()` if we know that `_resolved_indy_entries` is null. Thanks!

-------------

Marked as reviewed by matsaave (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26770#pullrequestreview-3133812806


More information about the hotspot-dev mailing list