Memory Corruption in JDK-21 on x86_64 with AVX-512

Xiaohong Gong Xiaohong.Gong at arm.com
Wed Sep 27 06:57:07 UTC 2023


Hi Carter,

Thanks for reporting this issue!

It seems the issue is caused by the calling of the super class’s “Ideal()” method in “LoadVectorMaskedNode::Ideal()” (code is: 8286941: Add mask IR for partial vector operations for ARM SVE by XiaohongGong · Pull Request #9037 · openjdk/jdk (github.com)<https://github.com/openjdk/jdk/pull/9037/files#diff-692826251cae892bc4737919579c6afbd317551cd507f99c7bd29d585c1282e2R1028>).
Some optimization applied on “LoadNode” is not suitable for “LoadVectorMaskedNode” now. Reverting it back to “return nullptr” can make your benchmark pass.

I will look at this issue and try to fix it next. Thanks!

Best Regards,
Xiaohong

From: hotspot-compiler-dev <hotspot-compiler-dev-retn at openjdk.org> On Behalf Of Carter Kozak
Sent: Wednesday, September 27, 2023 3:54 AM
To: hotspot-compiler-dev at openjdk.org
Subject: Memory Corruption in JDK-21 on x86_64 with AVX-512

Hello,

In an attempt to use JDK-21, we have discovered what appears to be a memory corruption issue where a byte-array is missing data in the middle (unexpectedly filled with zeros). This only occurs when AVX-512 is enabled (-XX:UseAVX=3), and cannot be reproduced with -XX:UseAVX=2.

I have pushed a reproducer here: https://github.com/carterkozak/avx512-jit-reproducer

This impacts generally available releases of JDK-20 and JDK-21. I have bisected the failure to this change, which I wouldn’t expect to be problematic, yet does seem to trigger the failure reliably: https://github.com/openjdk/jdk/pull/9037.

While I have some experience replaying compiler failures, this bug doesn’t cause a crash or otherwise trip assertions in fastdebug or slowdebug builds that would give me a good place to start. I haven’t been able to find a great deal of literature on the best practices for constructing a reproducer/reporting the problem in detail — it took me more time than I’d like to admit to build what I have, and I’d be grateful for pointers that might help narrow things down next time.

Best,
Carter Kozak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-compiler-dev/attachments/20230927/a23754fe/attachment.htm>


More information about the hotspot-compiler-dev mailing list