Skip to content

8316229: Enhance class initialization logging #15809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

dholmes-ora
Copy link
Member

@dholmes-ora dholmes-ora commented Sep 19, 2023

This change adds some additional debug logging to the class linking and initialization process. It was useful in diagnosing the deadlock described by:

https://bugs.openjdk.org/browse/JDK-8316469

See the example output in JBS issue.

The changes are mostly uncontroversial but I needed to expose a way to access the init thread's name, which can't use the regular name() method as the safety check doesn't recognise the calling context as being safe.

Testing:

  • manual examination of logging output
  • ran the only test that enables class+init logging: runtime/logging/ClassInitializationTest.java (no change as expected)
  • tiers1-3 sanity

Thanks.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8316229: Enhance class initialization logging (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15809/head:pull/15809
$ git checkout pull/15809

Update a local copy of the PR:
$ git checkout pull/15809
$ git pull https://git.openjdk.org/jdk.git pull/15809/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15809

View PR using the GUI difftool:
$ git pr show -t 15809

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15809.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 19, 2023

👋 Welcome back dholmes! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 19, 2023
@openjdk
Copy link

openjdk bot commented Sep 19, 2023

@dholmes-ora The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Sep 19, 2023
@mlbridge
Copy link

mlbridge bot commented Sep 19, 2023

Webrevs

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I have only stylistic questions/suggestions.

@dholmes-ora
Copy link
Member Author

Thanks for looking at this @shipilev !

@openjdk
Copy link

openjdk bot commented Sep 20, 2023

@dholmes-ora This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8316229: Enhance class initialization logging

Reviewed-by: shade, coleenp

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 97 new commits pushed to the master branch:

  • 242eeae: 8286757: adlc tries to build with /pathmap but without /experimental:deterministic
  • b275bdd: 8308995: Update Network IO JFR events to be static mirror events
  • e1870d3: 8316411: compiler/compilercontrol/TestConflictInlineCommands.java fails intermittent with force inline by CompileCommand missing
  • ec74194: 8316546: Backout JDK-8315932: runtime/InvocationTests spend a lot of time on dependency verification
  • 2568188: 8316547: Use JUnit.dir jtreg property with jpackage JUnit tests
  • 833a828: 8315876: Open source several Swing CSS related tests
  • 7ce5bd1: 8316468: os::write incorrectly handles partial write
  • d19e017: 8315951: Open source several Swing HTMLEditorKit related tests
  • 62c0a1b: 8315883: Open source several Swing JToolbar tests
  • 0c97246: 8311113: Remove invalid pointer cast and clean up setLabel() in awt_MenuItem.cpp
  • ... and 87 more: https://git.openjdk.org/jdk/compare/23fab1181b6a053efc4661d5a10caa90b109aa06...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 20, 2023
Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable. I like the variable for log_is_enabled, keeps it from being less intrusive.
Edit: too intrusive.

@dholmes-ora
Copy link
Member Author

Thanks for the reviews @shipilev and @coleenp !

/integrate

@openjdk
Copy link

openjdk bot commented Sep 21, 2023

Going to push as commit 8412479.
Since your change was applied there have been 108 commits pushed to the master branch:

  • c04c9ea: 8316627: JViewport Test headless failure
  • 5cacf21: 8316156: ByteArrayInputStream.transferTo causes MaxDirectMemorySize overflow
  • 3461c7b: 8316532: Native library copying in BuildMicrobenchmark.gmk cause dups on macOS
  • 3301fb1: 8315869: UseHeavyMonitors not used
  • 54028e7: 8316562: serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java times out after JDK-8314829
  • 7c991cc: 8296246: Update Unicode Data Files to Version 15.1.0
  • a021dbc: 8316149: Open source several Swing JTree JViewport KeyboardManager tests
  • 455cfae: 8315880: change LockingMode default from LM_LEGACY to LM_LIGHTWEIGHT
  • 9e00949: 8316427: Duplicated code for {obj,type}ArrayKlass::array_klass
  • c43ebd3: 8315981: Opensource five more random Swing tests
  • ... and 98 more: https://git.openjdk.org/jdk/compare/23fab1181b6a053efc4661d5a10caa90b109aa06...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 21, 2023
@openjdk openjdk bot closed this Sep 21, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 21, 2023
@openjdk
Copy link

openjdk bot commented Sep 21, 2023

@dholmes-ora Pushed as commit 8412479.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@dholmes-ora dholmes-ora deleted the 8316229-class-init branch September 21, 2023 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants