RFR: 8364735: [asan] heap-use-after-free error detected in defaultStream::writer during VM shutdown

Kim Barrett kbarrett at openjdk.org
Wed Aug 20 03:02:36 UTC 2025


On Wed, 20 Aug 2025 02:36:48 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/utilities/ostream.cpp line 1001:
>> 
>>> 999:   xtty = nullptr;
>>> 1000:   OrderAccess::fence(); // force visibility to concurrently executing threads
>>> 1001:   delete ds;
>> 
>> There are lots of places in the VM that don't even try to clean up on VM exit. I think we even talk
>> about non-cleanup on exit in the style guide. So why are we doing this cleanup, in such a potentially
>> sensitive/fragile area?
>
> Because we are flushing and closing the output streams so their content will be made available.

flush, sure.  but closing and deleting seems to be asking for trouble.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26832#discussion_r2286859537


More information about the hotspot-dev mailing list