JDK-8345173 : BlockLocationPrinter::print_location misses a ResourceMark
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 17,21,23
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-11-28
  • Updated: 2025-06-26
  • Resolved: 2024-12-02
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
24 b27Fixed
Related Reports
Causes :  
Description
BlockLocationPrinter::print_location uses oopDesc::print_on() which expects the caller to provide a ResourceMark.

Since BlockLocationPrinter::print_location() can be printed at arbitrary times (e.g. via MacroAssembler::stop()), it needs to provide its own ResourceMark for successful register printing.

This is an issue since the introduction of this helper class (JDK 14).
Comments
[jdk21u-fix-request] Approval Request from Satyen Subramaniam for backport of JDK-8345173: BlockLocationPrinter::print_location misses a ResourceMark Motivation: Without this change BlockLocationPrinter::print_location can be called at very arbitrary places (e.g. the stop() method of MacroAssembler), and without this change it might fail with a "Missing ResourceMark error - possible memory leak" error instead of providing the stop() output (and then failing). With this change, the ResourceMark should no longer have a possibility of crashing in this way. Risk: Low. Ran GHA Sanity Checks, and local Tier 1 and 2 tests directly. Patch is clean. Change has been present in tip since December, 2024.
17-06-2025

[jdk17u-fix-request] Approval Request from Satyen Subramaniam for backport of JDK-8345173: BlockLocationPrinter::print_location misses a ResourceMark Motivation: Without this change BlockLocationPrinter::print_location can be called at very arbitrary places (e.g. the stop() method of MacroAssembler), and without this change it might fail with a "Missing ResourceMark error - possible memory leak" error instead of providing the stop() output (and then failing). With this change, the ResourceMark should no longer have a possibility of crashing in this way. Risk: Low. Ran GHA Sanity Checks, and local Tier 1 and 2 tests directly. Patch is clean. Change has been present in tip since December, 2024.
17-06-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk17u-dev/pull/3665 Date: 2025-06-17 17:36:10 +0000
17-06-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk21u-dev/pull/1896 Date: 2025-06-17 17:35:10 +0000
17-06-2025

Changeset: f5ebda43 Branch: master Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2024-12-02 06:32:43 +0000 URL: https://git.openjdk.org/jdk/commit/f5ebda43709984214a25e23926860fea2ba5819a
02-12-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/22455 Date: 2024-11-29 09:36:16 +0000
29-11-2024