RFR: 8286182: C2: crash with SIGFPE when executing compiled code
Quan Anh Mai
duke at openjdk.java.net
Tue May 17 01:58:42 UTC 2022
On Mon, 16 May 2022 12:36:43 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
> The bug is not assigned to me, but I have seen that the C2 code which checks for div by 0 is not aware of the new nodes from [JDK-8284742](https://bugs.openjdk.java.net/browse/JDK-8284742).
> This fixes the VM to pass the reproducer. I'm not sure if more opcode checks are required to get added.
Thanks a lot for taking a look at this. I am considering this option, too. The problem is that `NoOvfDivI` does not only depend on the zero-divisor check but a possible overflow check as well. So with this fix it is still possible for a `SIGFPE` to occur.
IIUC this trouble comes from the fact that on x86 a `Div` node must be pinned to its zero-divisor check but may float with regards to other control nodes. Maybe we can remove all this special handling and simply catch `SIGFPE` instead? The result is guaranteed to not be used in those cases so we may not worry about the correctness of the compiled code.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8726
More information about the hotspot-compiler-dev
mailing list