JDK-8316229 : Enhance class initialization logging
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17,21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-09-13
  • Updated: 2023-11-27
  • Resolved: 2023-09-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22 b17Fixed
Related Reports
Relates :  
Description
While trying to debug an apparent class initialization deadlock we could see that some threads were waiting for initialization to be completed, but there was no sign of any thread actually doing that initialization. We should add additional debug-level logging to show when threads wait and what thread they are waiting for, as well a showing which thread is performing the actual initialization.
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u/pull/406 Date: 2023-11-27 12:50:06 +0000
27-11-2023

[jdk21u-fix-request] Approval Request from Aleksey Shipilëv Clean backport to improve JVM diagnostics. There is no bugtail recorded after few months in mainline.
27-11-2023

Changeset: 84124794 Author: David Holmes <dholmes@openjdk.org> Date: 2023-09-21 00:50:33 +0000 URL: https://git.openjdk.org/jdk/commit/84124794c2ff70ba22cbfbf1ff01cf4d935896bd
21-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15809 Date: 2023-09-19 06:33:02 +0000
19-09-2023

Sample output for the deadlock case [0.164s][info ][class,init] Start class verification for: MutableHttpFieldsDeadlock [0.165s][info ][class,init] End class verification for: MutableHttpFieldsDeadlock [0.165s][debug][class,init] Thread main linking java.lang.PublicMethods$MethodList [0.165s][debug][class,init] Thread main is initializing java.lang.PublicMethods$MethodList [0.165s][info ][class,init] 312 Initializing 'java/lang/PublicMethods$MethodList'(no method) (0x00007f63b2111db8) by thread main [0.165s][debug][class,init] Thread main linking java.lang.PublicMethods$Key [0.166s][debug][class,init] Thread main is initializing java.lang.PublicMethods$Key [0.166s][info ][class,init] 313 Initializing 'java/lang/PublicMethods$Key' (0x00007f63b2112260) by thread main [0.166s][debug][class,init] Thread main recursively initializing java.lang.PublicMethods$Key [0.166s][debug][class,init] Thread main linking java.lang.Void [0.166s][debug][class,init] Thread main is initializing java.lang.Void [0.166s][info ][class,init] 314 Initializing 'java/lang/Void' (0x00007f63b209f5a0) by thread main [0.166s][debug][class,init] Thread main recursively initializing java.lang.Void [0.166s][debug][class,init] Thread main is initializing MutableHttpFieldsDeadlock [0.166s][info ][class,init] 315 Initializing 'MutableHttpFieldsDeadlock'(no method) (0x00007f63b3000800) by thread main [0.166s][debug][class,init] Thread main linking MutableHttpFieldsDeadlock$1 [0.166s][info ][class,init] Start class verification for: MutableHttpFieldsDeadlock$1 [0.166s][info ][class,init] End class verification for: MutableHttpFieldsDeadlock$1 [0.166s][debug][class,init] Thread main is initializing MutableHttpFieldsDeadlock$1 [0.166s][info ][class,init] 316 Initializing 'MutableHttpFieldsDeadlock$1'(no method) (0x00007f63b3000a10) by thread main [0.166s][debug][class,init] Thread main linking java.lang.Thread$ThreadNumbering [0.166s][debug][class,init] Thread main is initializing java.lang.Thread$ThreadNumbering [0.167s][info ][class,init] 317 Initializing 'java/lang/Thread$ThreadNumbering' (0x00007f63b3040d60) by thread main [0.167s][debug][class,init] Thread main recursively initializing java.lang.Thread$ThreadNumbering [0.167s][debug][class,init] Thread main linking java.lang.reflect.Field [0.167s][debug][class,init] Thread main is initializing java.lang.reflect.Field [0.167s][info ][class,init] 318 Initializing 'java/lang/reflect/Field'(no method) (0x00007f63b204ca30) by thread main [0.167s][debug][class,init] Thread main recursively initializing java.lang.Thread$ThreadNumbering [0.167s][debug][class,init] Thread main recursively initializing java.lang.Thread$ThreadNumbering [0.167s][debug][class,init] Thread main recursively initializing java.lang.Thread$ThreadNumbering [0.167s][debug][class,init] Thread main recursively initializing java.lang.Thread$ThreadNumbering [0.169s][debug][class,init] Thread main linking HttpFields [0.169s][info ][class,init] Start class verification for: HttpFields [0.169s][info ][class,init] End class verification for: HttpFields [0.169s][debug][class,init] Thread main linking MutableHttpFieldsDeadlock$2 [0.169s][info ][class,init] Start class verification for: MutableHttpFieldsDeadlock$2 [0.169s][info ][class,init] End class verification for: MutableHttpFieldsDeadlock$2 [0.169s][debug][class,init] Thread main is initializing MutableHttpFieldsDeadlock$2 [0.169s][debug][class,init] Thread main is initializing HttpFields [0.169s][info ][class,init] 319 Initializing 'HttpFields' (0x00007f63b3000d28) by thread main [0.169s][debug][class,init] Thread Thread-0 linking HttpFields$Mutable [0.169s][info ][class,init] Start class verification for: HttpFields$Mutable [0.170s][debug][class,init] Thread main linking Sleeper [0.170s][info ][class,init] Start class verification for: Sleeper [0.170s][info ][class,init] End class verification for: HttpFields$Mutable [0.170s][debug][class,init] Thread Thread-0 linking MutableHttpFields [0.170s][info ][class,init] Start class verification for: MutableHttpFields [0.170s][info ][class,init] End class verification for: MutableHttpFields [0.170s][debug][class,init] Thread Thread-0 linking Message [0.170s][info ][class,init] Start class verification for: Message [0.170s][info ][class,init] End class verification for: Message [0.170s][info ][class,init] End class verification for: Sleeper [0.170s][debug][class,init] Thread Thread-0 is initializing Message [0.170s][debug][class,init] Thread Thread-0 is initializing MutableHttpFields [0.170s][debug][class,init] Thread Thread-0 waiting for initialization of HttpFields by thread main [0.170s][debug][class,init] Thread main is initializing Sleeper [0.170s][info ][class,init] 320 Initializing 'Sleeper' (0x00007f63b30016b8) by thread main [0.170s][debug][class,init] Thread main linking jdk.internal.event.Event [0.170s][debug][class,init] Thread main linking jdk.internal.event.ThreadSleepEvent [0.171s][debug][class,init] Thread main is initializing jdk.internal.event.ThreadSleepEvent [0.171s][debug][class,init] Thread main is initializing jdk.internal.event.Event [0.171s][info ][class,init] 321 Initializing 'jdk/internal/event/Event'(no method) (0x00007f63b3041618) by thread main [0.171s][info ][class,init] 322 Initializing 'jdk/internal/event/ThreadSleepEvent' (0x00007f63b3041a98) by thread main [0.171s][debug][class,init] Thread main recursively initializing jdk.internal.event.ThreadSleepEvent [0.171s][debug][class,init] Thread main recursively initializing jdk.internal.event.ThreadSleepEvent [0.176s][debug][class,init] Thread main recursively initializing HttpFields [0.176s][debug][class,init] Thread main waiting for initialization of MutableHttpFields by thread Thread-0
19-09-2023