RFR: 8364735: [asan] heap-use-after-free error detected in defaultStream::writer during VM shutdown [v2]
Johan Sjölen
jsjolen at openjdk.org
Tue Sep 2 06:42:43 UTC 2025
On Fri, 29 Aug 2025 01:02:43 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> `ostream_exit` was deleting the stream underlying the `xtty` prior to nulling the `xtty` global variable, resulting in a use-after-free-error. Due to races during VM shutdown we cannot make use of `xtty` perfectly safe, but we can certainly narrow the window during which use-after-free is possible.
>>
>> Testing:
>> - tiers 1-3 sanity
>>
>> Thanks
>
> David Holmes has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>
> - Merge branch 'master' into 8364735-xtty
> - 8364735: [asan] heap-use-after-free error detected in defaultStream::writer during VM shutdown
After considering all of the discussions above and David's subsequent investigation, I think it seems reasonable to accept David's fix. Perhaps a refactoring is due, but that can be in a future PR.
-------------
Marked as reviewed by jsjolen (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/26832#pullrequestreview-3175082255
More information about the hotspot-dev
mailing list