Skip to content

8349753: Incorrect use of CodeBlob::is_buffer_blob() in few places #23607

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 1 commit into from

Conversation

vnkozlov
Copy link
Contributor

@vnkozlov vnkozlov commented Feb 13, 2025

CodeBlob::is_buffer_blob() method is incorrectly used in few places because BufferBlob is not "leaf" class. You need to add checks for its subclasses too.

I also updated statistic output for CodeCache (-XX:+PrintCodeCache -XX:+Verbose) and corresponding test to reflect current state of code blobs.

Tested tier1-4, stress, xcomp

New output:

Non-nmethod blobs:
 #67 runtime = 43K (hdr 4K 10%, loc 1K 3%, code 36K 84%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #0 upcall = 0K
 #1 uncommon trap = 0K (hdr 0K 13%, loc 0K 2%, code 0K 84%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #1 deoptimization = 2K (hdr 0K 3%, loc 0K 1%, code 2K 94%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #1 exception = 0K (hdr 0K 30%, loc 0K 3%, code 0K 63%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #3 safepoint = 4K (hdr 0K 4%, loc 0K 1%, code 4K 93%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #639 adapter = 955K (hdr 44K 4%, loc 24K 2%, code 880K 92%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #1 mh_adapter = 10K (hdr 0K 0%, loc 0K 0%, code 9K 99%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #1 vtable = 32K (hdr 0K 0%, loc 0K 0%, code 32K 99%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #12 buffer blob = 917K (hdr 0K 0%, loc 0K 0%, code 916K 99%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #0 other = 0K

Output before:

Non-nmethod blobs:
 #66 runtime = 42K (hdr 4K 10%, loc 1K 3%, code 36K 84%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #1 uncommon trap = 0K (hdr 0K 13%, loc 0K 2%, code 0K 84%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #1 deoptimization = 2K (hdr 0K 3%, loc 0K 1%, code 2K 94%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #639 adapter = 955K (hdr 44K 4%, loc 24K 2%, code 880K 92%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #12 buffer blob = 917K (hdr 0K 0%, loc 0K 0%, code 916K 99%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])
 #6 other = 47K (hdr 0K 0%, loc 0K 0%, code 46K 98%, stub 0K 0%, [oops 0K 0%, metadata 0K 0%, data 0K 0%, pcs 0K 0%])

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-8349753: Incorrect use of CodeBlob::is_buffer_blob() in few places (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23607

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 13, 2025

👋 Welcome back kvn! 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
Copy link

openjdk bot commented Feb 13, 2025

@vnkozlov 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:

8349753: Incorrect use of CodeBlob::is_buffer_blob() in few places

Reviewed-by: dlong, shade

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 8 new commits pushed to the master branch:

  • a637ccf: 8349851: RISC-V: Call VM leaf can use movptr2
  • adc3f53: 8349787: java/lang/Thread/virtual/ThreadPollOnYield.java#default passes unexpectedly without libVThreadPinner.so
  • 55097dd: 8344802: Crash in StubRoutines::verify_mxcsr with -XX:+EnableX86ECoreOpts and -Xcheck:jni
  • b8576eb: 6562489: Font-Renderer should ignore invisible characters \u2062 and \u2063
  • 7a0832f: 8349934: Wrong file regex for copyright header format check in .jcheck/conf
  • 2a5d1da: 8349571: Remove JavaThreadFactory interface from SA
  • 74e458b: 8349684: Remove SA core file tests from problem list for macosx-x64
  • ba28119: 8348427: DeferredLintHandler API should use JCTree instead of DiagnosticPosition

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 rfr Pull request is ready for review label Feb 13, 2025
@openjdk
Copy link

openjdk bot commented Feb 13, 2025

@vnkozlov The following labels will be automatically applied to this pull request:

  • hotspot
  • serviceability

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

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Feb 13, 2025
@mlbridge
Copy link

mlbridge bot commented Feb 13, 2025

Webrevs

Copy link
Member

@dean-long dean-long left a comment

Choose a reason for hiding this comment

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

Looks good.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 13, 2025
@vnkozlov
Copy link
Contributor Author

Thank you, Dean

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.

Looks fine. I spot-checked other CodeBlobKind-s, and I don't think we are missing any other.

@vnkozlov
Copy link
Contributor Author

Thank you, Aleksey, for review.

I will wait until PR for moving Relocation from CodeCache is integrated to not mess up @bulasevich work.

@vnkozlov
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Feb 13, 2025

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

  • 18958c6: 8349925: [REDO] Support static JDK in libfontmanager/freetypeScaler.c
  • c2fc947: 8349378: Build splashscreen lib with SIZE optimization
  • 5b75ff7: 8349907: jdk.tools.jlink.internal.plugins.ZipPlugin does not close the Deflater in exceptional cases
  • add3cd1: 8348600: Update PipeWire to 1.3.81
  • efc597b: 8349564: Clean warnings found in jpackage tests when building them with -Xlint:all
  • 29202d1: 8349648: Test tools/jpackage/share/JLinkOptionsTest.java fails with --enable-linkable-runtime set after JDK-8346434
  • 24b7f81: 8349783: g1RemSetSummary.cpp:344:68: runtime error: member call on null pointer of type 'struct G1HeapRegion'
  • a637ccf: 8349851: RISC-V: Call VM leaf can use movptr2
  • adc3f53: 8349787: java/lang/Thread/virtual/ThreadPollOnYield.java#default passes unexpectedly without libVThreadPinner.so
  • 55097dd: 8344802: Crash in StubRoutines::verify_mxcsr with -XX:+EnableX86ECoreOpts and -Xcheck:jni
  • ... and 5 more: https://git.openjdk.org/jdk/compare/c5ac3c4f11e777b24d597deec522c9df09750f59...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 13, 2025

@vnkozlov Pushed as commit 0b50e47.

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

@vnkozlov vnkozlov deleted the 8349753 branch February 13, 2025 16:13
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 serviceability serviceability-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants