JDK-8349753 : Incorrect use of CodeBlob::is_buffer_blob() in few places
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 24,25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-02-10
  • Updated: 2025-02-21
  • Resolved: 2025-02-13
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 24 JDK 25
24.0.2Fixed 25 b11Fixed
Related Reports
Causes :  
Description
While working on JDK-8349088 I realized that `CodeBlob::is_buffer_blob()` is incorrectly used in few places because BufferBlob is not "leaf" class. All other `is_*()` methods are fine because they correspond to "leaf" subclasses.

The method is mostly used for prints and statistic. Like in `CodeBlob::dump_for_addr()` and `CodeCache::print_internals()`.

The only problematic place is in `CodeBlobCollector::do_blob()` where `if (cb->is_buffer_blob() && strcmp(cb->name(), "vtable chunks") == 0)` should be replaces with `(cb->is_vtable_blob())`.  
That code works anyway because `CodeBlobCollector::do_vtable_stub()` is called first and `CodeBlobCollector::do_blob()` skips blobs which are already recorded.

Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk24u/pull/87 Date: 2025-02-21 19:10:54 +0000
21-02-2025

Fix request for JDK 24u. Low risk - fix affects only prints output about generated code. Tested in JDK 25 in tier1-4. Integrated into JDK 25 week ago - no issues were found since then.
20-02-2025

Changeset: 0b50e479 Branch: master Author: Vladimir Kozlov <kvn@openjdk.org> Date: 2025-02-13 16:09:04 +0000 URL: https://git.openjdk.org/jdk/commit/0b50e479a060cf745a3e858d535516444fe80fd8
13-02-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23607 Date: 2025-02-13 01:22:55 +0000
13-02-2025

ILW = Wrong method used to check if entry in code cache is a buffer blob (regression in JDK 23 - benign), never observed, no workaround = MLH = P4
11-02-2025

This is not critical issue so we can fix in JDK 24 update release.
10-02-2025