RFR: 8368124: Show useful thread names in ASAN reports [v4]

Thomas Stuefe stuefe at openjdk.org
Wed Sep 24 05:31:14 UTC 2025


On Wed, 24 Sep 2025 01:14:59 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/os/linux/os_linux.cpp line 4868:
>> 
>>> 4866:   // set name in kernel
>>> 4867:   int rc = prctl(PR_SET_NAME, buf);
>>> 4868:   assert(rc == 0, "prctl(PR_SET_NAME) failed");
>> 
>> shouldn't we check also the return code rc in release builds and not only assert ?
>
> I don't think so. If this "fails" what could we do? This should not be presented as a failure to the end user.

The assert on pthread_setname was there for ages and never fired. The asserts are there to tell us, in our test landscapes, whether this ever fails. If it does, we can look for the reasons and possibly remove the assert. 

In release builds the error should be ignored, since the user cannot do anything about it and the consequences don't matter that much.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27395#discussion_r2374448251


More information about the hotspot-dev mailing list