<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi Carter,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks for reporting this issue!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">It seems the issue is caused by the calling of the super class’s “Ideal()” method in “LoadVectorMaskedNode::Ideal()” (code is:
<a href="https://github.com/openjdk/jdk/pull/9037/files#diff-692826251cae892bc4737919579c6afbd317551cd507f99c7bd29d585c1282e2R1028">
8286941: Add mask IR for partial vector operations for ARM SVE by XiaohongGong · Pull Request #9037 · openjdk/jdk (github.com)</a>).
<o:p></o:p></p>
<p class="MsoNormal">Some optimization applied on “LoadNode” is not suitable for “LoadVectorMaskedNode” now. Reverting it back to “return nullptr” can make your benchmark pass.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I will look at this issue and try to fix it next. Thanks!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best Regards,<o:p></o:p></p>
<p class="MsoNormal">Xiaohong<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> hotspot-compiler-dev <hotspot-compiler-dev-retn@openjdk.org>
<b>On Behalf Of </b>Carter Kozak<br>
<b>Sent:</b> Wednesday, September 27, 2023 3:54 AM<br>
<b>To:</b> hotspot-compiler-dev@openjdk.org<br>
<b>Subject:</b> Memory Corruption in JDK-21 on x86_64 with AVX-512<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hello,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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 (<code><span style="font-size:10.0pt">-XX:UseAVX=3</span></code>),
and cannot be reproduced with <code><span style="font-size:10.0pt">-XX:UseAVX=2</span></code>.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I have pushed a reproducer here: <a href="https://github.com/carterkozak/avx512-jit-reproducer">
https://github.com/carterkozak/avx512-jit-reproducer</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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:
<a href="https://github.com/openjdk/jdk/pull/9037">https://github.com/openjdk/jdk/pull/9037</a>.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">While I have some experience replaying compiler failures, this bug doesn’t cause a crash or otherwise trip assertions in
<code><span style="font-size:10.0pt">fastdebug</span></code> or <code><span style="font-size:10.0pt">slowdebug</span></code> 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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Best,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Carter Kozak<o:p></o:p></p>
</div>
</div>
</body>
</html>