RFR(XS): 8193308: Disallow installing user signal handlers for SIGBUS on OSX

David Holmes david.holmes at oracle.com
Sun Feb 11 13:36:42 UTC 2018


On 11/02/2018 3:37 AM, mandy chung wrote:
> On 2/10/18 3:24 AM, David Holmes wrote:
>> On 10/02/2018 5:18 PM, mandy chung wrote:
>>>>>
>>>>> I think JVM_RegisterSignal should disallow installing a user 
>>>>> handler for one of the implementation-specific signals for all 
>>>>> platforms. That'll simplify your fix.  I would think the 
>>>>> compatibility risk should be low as rare cases would want to 
>>>>> intercept SIGBUS which is also clearly documented in [1].
>>>>
>>>> Each platform defines its own set of signals that are used by the VM 
>>>> on that platform. While I've never thought it made any sense to 
>>>> attempt to install user "handlers" for SIGBUS or SIGSEGV (not that 
>>>> we allow the latter) others have argued that unless we use it then 
>>>> we should allow it. Hence no "lowest common denominator" approach - 
>>>> though that certainly would be simpler.
>>>>
>>>> In this case I believe it is simply another case where the OS X port 
>>>> copied the Linux code and it wasn't realized that OS X would 
>>>> generate SIGBUS when SIGSEGV is "expected" and so didn't list it as 
>>>> excluded.
>>>
>>> Are we agreeing on disallowing SIGBUS for all platforms?
>>
>> No. If the VM doesn't use SIGBUS on a platform then it shouldn't 
>> disallow it.
>>
> 
> JVM_RegisterSignal is the VM support for sun.misc.Signal.   As it does 
> not make sense to install user handlers for SIGBUS, regardless whether 
> the VM uses it or not, I suggest to disallow it from JVM_RegisterSignal 
> for consistency.

I've argued this in the past and was shot down. If the VM doesn't use a 
signal then it's fair game for end-user use.

The only thing broken here was OS X and that is now fixed.

David

> Mandy


More information about the hotspot-runtime-dev mailing list