RFR: 8374448: SIGSEGV in ConstantPool::print_value_on with -XX:CompileCommand=print

Kerem Kat krk at openjdk.org
Mon Feb 9 21:59:30 UTC 2026


`BSMAttributeEntries::is_empty()` used AND, so `!is_empty()` was true when only one of `_offsets`/`_bootstrap_methods` was non-null. Callers then dereferenced the null pointer.

Changed to OR so `!is_empty()` guarantees both are non-null. Added asserts at the two assignment sites to check for consistency.

Please note that I could not reproduce this in fastdebug or slowdebug builds on x86_64 Linux.

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

Commit messages:
 - 8374448: SIGSEGV in ConstantPool::print_value_on with -XX:CompileCommand=print

Changes: https://git.openjdk.org/jdk/pull/29611/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29611&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8374448
  Stats: 3 lines in 2 files changed: 2 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/29611.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29611/head:pull/29611

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


More information about the hotspot-dev mailing list