RFR: 8284632: runtime/Thread/StopAtExit.java possibly leaking memory again [v2]

David Holmes dholmes at openjdk.java.net
Tue May 3 00:36:23 UTC 2022


On Mon, 2 May 2022 21:43:50 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> src/hotspot/share/runtime/thread.cpp line 1674:
>> 
>>> 1672:     HandshakeClosure("InstallAsyncException"), _aeh(aeh) {}
>>> 1673:   ~InstallAsyncExceptionHandshake() {
>>> 1674:     delete _aeh;
>> 
>> A comment would have been good. I'm assuming:
>> 
>> // Can only be non-null if this handshake was never actually executed.
>
> Since we clear `_aeh` on L1679 below when `do_thread()` is executed, `_aeh` can
> only be non-NULL when `~InstallAsyncExceptionHandshake()` runs if `do_thread()`
> was never executed.
> 
> I can add that comment above L1674 in a separate bug fix if you wish.
> @robehn - do you concur that a comment here would be good?

It was the fact we null it and delete it that initially caused a "What the???" reaction. :) So I think I comment would be good but can wait.

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

PR: https://git.openjdk.java.net/jdk/pull/8388


More information about the hotspot-runtime-dev mailing list