RFR: 8266742: Check W^X state on possible safepoint

Anton Kozlov akozlov at openjdk.java.net
Thu May 13 16:12:03 UTC 2021


On Mon, 10 May 2021 05:23:29 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Hi,
>> 
>> Please review a check for W^X mode at safepoint. As described in the bug, this explicit check aims to catch the wrong W^X mode that may lead to a crash (such crashes are rather intermittent).
>> 
>> This check helped to verify the fix for https://bugs.openjdk.java.net/browse/JDK-8265292 and should help to discover similar issues. It is disabled by default to avoid unexpected failures in the regular use, but eventually it should be turned on unconditionally.
>> 
>> I still owe a complete W^X approach description. Hope this patch does not depend much on that.
>
> src/hotspot/os/bsd/globals_bsd.hpp line 39:
> 
>> 37:                          constraint)                                    \
>> 38:                                                                         \
>> 39:   AARCH64_ONLY(develop(bool, WXCheckAtSafepoint, false,                 \
> 
> Why not enable always as this is a develop build? Do we even need to manage this on a flag?
> 
> Also not really "safepoint" as the check also applies to handshakes.

Even in debug builds the check may be too assertive. This check exposes 22 failures in tier1 in jfr, gc, compiler, serviceability, and foreign (hope to be fixed soon), and they look like actual possible issues. So I suggest to have the option but keep it disabled. But if one meets with something similar to JDK-8265292, then it will be possible to reproduce otherwise intermittent crash.

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

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


More information about the hotspot-runtime-dev mailing list