RFR: 8312401: SymbolTable::do_add_if_needed hang when requesting length exceeds max_symbol_length [v3]

Jiangli Zhou jiangli at openjdk.org
Tue Jul 25 04:00:49 UTC 2023


On Tue, 25 Jul 2023 02:20:10 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> There are other calls to `java_lang_Throwable::detail_message()` that will overflow `Symbol::max_length()`, so adding this assert will just change the hang into a crash, neither is desirable.
> 
> If we want to properly fix `java_lang_Throwable::detail_message()` in a future RFE, it's better to temporarily change `java_lang_Throwable::detail_message()` in this PR to truncate the string (instead of hanging). That's a better alternative than crashing or hanging.

Thanks for the thoughts. We have't seen issues in other call paths. It's better to fix the other callers properly with JDK-8312616 instead of using a workaround (truncate) with an undefined behavior.

Failing with assert provides more useful information than hang, however most end users only run on release binary (so most users would not see asserts). As no hang has been reported in other call paths, I think the new asserts would not be triggered in those cases with debug binaries. I can also revert the new asserts in this PR if there's a concern.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14938#discussion_r1272970387


More information about the hotspot-runtime-dev mailing list