RFR: 8308764: Reporting errors from create_vm may crash [v2]

David Holmes dholmes at openjdk.org
Mon Jun 5 00:12:10 UTC 2023


On Sat, 3 Jun 2023 12:58:03 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> src/hotspot/share/runtime/threads.cpp line 554:
>> 
>>> 552:       main_thread->smr_delete();
>>> 553:     }
>>> 554:     // Else don't delete main_thread as we need to report exceptions in the caller.
>> 
>> Is it really okay to just leak main_thread?  If the process is going to die anyway then sure, but I'm not sure
>> that's true for all potential callers.  Of course, there's probably lots of other stuff getting leaked, so maybe
>> it doesn't matter.
>
> I see this was already discussed, with the same rationale for not caring about the leak.

Thanks for looking at this Kim. With everything else we "leak" when we don't abort the process during VM init, adding the main thread to it would not make any difference IMO. But in any case with Coleen's suggestion we no longer "leak" the main thread as we will abort.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14238#discussion_r1217278216


More information about the hotspot-runtime-dev mailing list