RFR: 8367597: Runtime.exit logging failed: Cannot invoke "java.lang.Module.getClassLoader()" because "m" is null [v3]

Jaikiran Pai jpai at openjdk.org
Sat Sep 13 09:35:54 UTC 2025


> Can I please get a review of this change which addresses the issue noted in https://bugs.openjdk.org/browse/JDK-8367597? 
> 
> As noted in that issue, on certain occasions, during shutdown of the JVM, the logging in `Runtime.exit()` generates a `NullPointerException`. The issue is due to the JVM not being fully initialized when (concurrently) the signal handler thread calls the `Runtime.exit()` code which then attempts to log a message.
> 
> The commit in this PR skips the logging from `Runtime.exit()` if the JVM isn't fully initialized at that point in time. I've manually verified that this change indeed addresses the issue by running the same tests on the hosts where this was previously failing. No new regressions tests have been introduced given the nature of the issue.
> 
> tier1 testing with this change completed without any related issues and additional tier testing is currently in progress.

Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:

  move the check to Shutdown.exit()

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/27270/files
  - new: https://git.openjdk.org/jdk/pull/27270/files/993845cd..af6acf5f

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27270&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27270&range=01-02

  Stats: 8 lines in 1 file changed: 2 ins; 4 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/27270.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27270/head:pull/27270

PR: https://git.openjdk.org/jdk/pull/27270


More information about the core-libs-dev mailing list