RFR: 8267213: cpuinfo_segv is incorrectly triaged as execution protection violation on x86_32
Jie Fu
jiefu at openjdk.java.net
Mon May 24 07:39:59 UTC 2021
On Thu, 20 May 2021 11:24:13 GMT, Jie Fu <jiefu at openjdk.org> wrote:
> > Have you analysed the original crash to check what the actual pc and
> > addr values were?
>
> Hi @dholmes-ora ,
>
> After more investigation, I believe this is a signal handling bug.
>
> In this case, cpuinfo_segv is incorrectly triaged as execution protection violation on Linux/x86_32.
>
> During VM initialization, cpuinfo_segv [1] will be triggered (by accessing addr=0) on purpose.
>
> ```
> #0 VM_Version::get_processor_features () at /home/jdk/src/hotspot/cpu/x86/vm_version_x86.cpp:630
> #1 0xf720cc21 in VM_Version::initialize () at /home/jdk/src/hotspot/cpu/x86/vm_version_x86.cpp:1890
> #2 0xf7206d85 in VM_Version_init () at /home/jdk/src/hotspot/share/runtime/vm_version.cpp:32
> #3 0xf6b72e4f in init_globals () at /home/jdk/src/hotspot/share/runtime/init.cpp:119
> #4 0xf71500c6 in Threads::create_vm (args=0xf621a26c, canTryAgain=0xf621a1d3) at /home/jdk/src/hotspot/share/runtime/thread.cpp:2854
> #5 0xf6c6b167 in JNI_CreateJavaVM_inner (vm=0xf621a2bc, penv=0xf621a2c0, args=0xf621a26c) at /home/jdk/src/hotspot/share/prims/jni.cpp:3592
> #6 0xf6c6b35c in JNI_CreateJavaVM (vm=0xf621a2bc, penv=0xf621a2c0, args=0xf621a26c) at /home/jdk/src/hotspot/share/prims/jni.cpp:3680
> #7 0xf7fbe61f in InitializeJVM (pvm=0xf621a2bc, penv=0xf621a2c0, ifn=0xf621a300) at /home/jdk/src/java.base/share/native/libjli/java.c:1539
> #8 0xf7fbb283 in JavaMain (_args=0xffffa484) at /home/jdk/src/java.base/share/native/libjli/java.c:415
> #9 0xf7fc1bed in ThreadJavaMain (args=0xffffa484) at /home/jdk/src/java.base/unix/native/libjli/java_md.c:651
> #10 0xf7d983bd in start_thread (arg=0xf621ab40) at pthread_create.c:463
> ```
>
> The VM can recognizes it as cpuinfo_segv [2] here and assigned the stub.
> But unfortunately, it's re-triaged as execution protection violation on x86_32 when UnguardOnExecutionViolation > 0, which shouldn't happen.
>
> To avoid this kind of false-positive, one more condition `stub == NULL` is added.
>
> Note: we don't need to change windows since there is a special signal for this condition [3].
>
> Thanks.
> Best regards,
> Jie
>
> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/vm_version_x86.cpp#L466
> [2] https://github.com/openjdk/jdk/blob/master/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp#L246
> [3] https://github.com/openjdk/jdk/blob/master/src/hotspot/os/windows/os_windows.cpp#L2449
May I get reviews for this small fix?
Thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4044
More information about the hotspot-dev
mailing list