RFR: 8374448: SIGSEGV in ConstantPool::print_value_on with -XX:CompileCommand=print [v2]
Dmitry Chuyko
dchuyko at openjdk.org
Thu Feb 12 08:12:07 UTC 2026
On Wed, 11 Feb 2026 09:33:38 GMT, Kerem Kat <krk at openjdk.org> wrote:
>> `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.
>
> Kerem Kat has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>
> - Merge branch 'master' into fix-crash-cpprint-8374448
> - address comments
> - 8374448: SIGSEGV in ConstantPool::print_value_on with -XX:CompileCommand=print
Just in case, GCC (Red Hat 8.5.0-23) still issues warnings related to the same change, like following:
src/hotspot/share/oops/bsmAttribute.hpp: In member function ‘const Array<unsigned int>* const& BSMAttributeEntries::offsets() const’:
src/hotspot/share/oops/bsmAttribute.hpp:135:52: warning: returning reference to temporary [-Wreturn-local-addr]
const Array<u4>* const& offsets() const { return _offsets; }
^~~~~~~~
src/hotspot/share/oops/bsmAttribute.hpp: In member function ‘const Array<short unsigned int>* const& BSMAttributeEntries::bootstrap_methods() const’:
src/hotspot/share/oops/bsmAttribute.hpp:137:62: warning: returning reference to temporary [-Wreturn-local-addr]
const Array<u2>* const& bootstrap_methods() const { return _bootstrap_methods; }
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29611#issuecomment-3889297867
More information about the hotspot-dev
mailing list