RFR: 8368124: Show useful thread names in ASAN reports [v4]
Thomas Stuefe
stuefe at openjdk.org
Wed Sep 24 09:07:02 UTC 2025
On Wed, 24 Sep 2025 07:39:46 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> Sorry I'm still not grokking this 4 chars aspect. For whatever buffer size, if the length of the name < buffer_len we write it as-is. Otherwise we chop out the middle and replace with .. such that it fits in the buffer.
>
>> I'm really not understanding the "smart-threshold" here; nor does this seem worthy of being a utility function.
>
> I think it is a good string utility function; at least it is not only related only to the ASAN support but could be used for other things.
> Sorry I'm still not grokking this 4 chars aspect. For whatever buffer size, if the length of the name < buffer_len we write it as-is. Otherwise we chop out the middle and replace with .. such that it fits in the buffer.
Okay, I can remove that part. The output buffer has to have at least the length of the two dots then. Passing in a buffer of 2 would result in "..". Or possible "C."
The more I think about this, the more absurd this detail becomes. Thing is, the output buffer size is usually set statically and under the control of the hotspot developer (it will be usually the size of a char buffer). So we could probably just assert a minimum output buffer size.
Yes, I like this more.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27395#discussion_r2375106716
More information about the hotspot-dev
mailing list