RFR: 8254824: SignalHandlerMark have no purpose

David Holmes dholmes at openjdk.java.net
Thu Oct 15 23:00:15 UTC 2020


On Thu, 15 Oct 2020 13:18:33 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp line 404:
>> 
>>> 402:   Thread* t = Thread::current_or_null_safe();
>>> 403:
>>> 404:   // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
>> 
>> Should we keep a comment (and add to other files) to the effect that:
>> 
>> // If crash protection is installed we will longjmp away and no destructors from any RAII utility
>> // object would be run. So don't use any RAII utilities here.
>> 
>> ?
>
> // If crash protection is installed we may longjmp away and no destructors
>   // for objects in this scope will be run.
>   // So don't use any RAII utilities before crash protection is checked.
> 
> Since even if crash protection is installed it's not certain we will longjmp and you can trust destructors after we
> checked crash protection. ?

I'm not sure if only the call to `check_crash_protection` can trigger the long jump? If so then your version of the
comment is better.

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

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


More information about the hotspot-runtime-dev mailing list