RFR: 8356233: NMT: tty->print_cr should not be used in VirtualMemoryTracker::add_reserved_region() [v2]

Gerard Ziemski gziemski at openjdk.org
Tue May 20 16:05:38 UTC 2025


> To help with debugging NMT we added more info when an assert gets triggered, but we used `tty`, which is involved with locks and unfortunately it triggered:
> 
> 
> # Internal Error (.../open/src/hotspot/share/runtime/mutex.cpp:457), pid=1088443, tid=1088520
> # assert(false) failed: Attempting to acquire lock tty_lock/tty out of order with lock NmtVirtualMemory_lock/service-4 -- possible deadlock
> 
> 
> We avoid this, by printing using `UL` instead of using `tty` directly.

Gerard Ziemski has updated the pull request incrementally with one additional commit since the last revision:

  Johan's feedback

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/25308/files
  - new: https://git.openjdk.org/jdk/pull/25308/files/b32dbbec..985856ec

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25308&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25308&range=00-01

  Stats: 6 lines in 1 file changed: 0 ins; 3 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/25308.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25308/head:pull/25308

PR: https://git.openjdk.org/jdk/pull/25308


More information about the hotspot-runtime-dev mailing list