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

Johan Sjölen jsjolen at openjdk.org
Tue Feb 10 09:57:41 UTC 2026


On Tue, 10 Feb 2026 01:20:30 GMT, David Holmes <dholmes at openjdk.org> wrote:

> AFAICS the only way this failure can happen (which explains why it doesn't reproduce) is we are concurrently trying to print an entry (`bsm_entries()`) which is in the process of being updated (via `start_extension()`) and so we temporarily see an inconsistent state. We could accommodate that with the suggested change to `is_empty` but I would want add a comment explaining why we give the appearance that the two fields could be inconsistently null. But looking at the code that fails:
> 
> ```
>   if (!bsm_entries().is_empty())  st->print("/BSMs[%d]", bsm_entries().bootstrap_methods()->length());
> ```
> 
> it seems to me that a better way to avoid this potential race is to use:
> 
> ```
>   if (!bsm_entries().is_empty())  st->print("/BSMs[%d]", bsm_entries().array_length());
> ```
> 
> because `array_length` handles the case of `_bootstrap_methods` being null.

I think that your suggested change is good, regardless of whether it fixes this bug or not.

The crash seems trivial to reproduce for the reporter, and that's not typical for concurrency bugs.

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

PR Comment: https://git.openjdk.org/jdk/pull/29611#issuecomment-3876561217


More information about the hotspot-dev mailing list