<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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#467886;
        text-decoration:underline;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Aptos",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-DE" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="en-DE">Hi Magnus,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="en-DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="en-DE">></span><span lang="en-DE"> </span>I think there might be ways around that to tell the linker to actually keep the symbols we need. If you want to pursue integrating msan into the JDK build properly, we can explore that.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am still a bit unsure about integrating the msan support , because with just the msan support in the m4+makefiles , but still msan-related runtime issues showing up in the build,<o:p></o:p></p>
<p class="MsoNormal">It  would not be very helpful for  the developers.<o:p></o:p></p>
<p class="MsoNormal">(on the other hand, ubsan  in OpenJDK  was some months  ago also only  supported in the m4+makefiles  but needed ‘repair’  regarding source adjustments because issues already showed up in the build )
<span lang="en-DE"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="en-DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="en-DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="en-DE">>>Seems msan is unhappy about the thread != nullptr   in line 81  of  jfrThreadLocal.cpp</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">>I have no idea. Did you pursue this any further, or did you give up?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="en-DE">I updated to a higher version of clang  (17) and then the issue was gone ; but unfortunately there are more msan – related  issues reported  in Hotspot  already in the build process .<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="en-DE">And different to ubsan/asan ,  for me the msan issues are harder to understand    (but maybe I am just not used to the reports yet ) .<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="en-DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="en-DE">Maybe , let’s see what comes out of this one 
<a href="https://bugs.openjdk.org/browse/JDK-8356285">https://bugs.openjdk.org/browse/JDK-8356285</a>  .<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="en-DE">(sometimes the HS codebase seem to does things that are not liked by MSAN ; maybe the  JDK native libs are easier to support for MSAN )<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="en-DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="en-DE">Best regards, Matthias<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="en-DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="en-DE"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-family:"Calibri",sans-serif;mso-ligatures:none;mso-fareast-language:#2000">From:</span></b><span lang="EN-US" style="font-family:"Calibri",sans-serif;mso-ligatures:none;mso-fareast-language:#2000"> Magnus
 Ihse Bursie <magnus.ihse.bursie@oracle.com> <br>
<b>Sent:</b> Thursday, 19 June 2025 17:07<br>
<b>To:</b> Baesken, Matthias <matthias.baesken@sap.com>; build-dev@openjdk.org<br>
<b>Subject:</b> Re: clang Memory sanitizer (msan) and OpenJDK<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi Matthias,<o:p></o:p></p>
<p>Getting back to this far too late... Sorry.<o:p></o:p></p>
<p>On 2025-04-30 15:28, Baesken, Matthias wrote:<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="en-DE">I installed the llvm package to get the   /usr/bin/llvm-symbolizer   (this seems to be needed to get  meaningful stacks) .<br>
<br>
Brought back the visibility=hidden settings, seems they do no harm  to msan  .   However the removal  of  -Wl,--exclude-libs,ALL      is needed.</span><o:p></o:p></p>
</blockquote>
<p>I think there might be ways around that to tell the linker to actually keep the symbols we need. If you want to pursue integrating msan into the JDK build properly, we can explore that. If so, we should also check for the presence of llvm-symbolizer in configure
 and warn if it is missing (though I guess the real question is if it is present at runtime...).<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="en-DE"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="en-DE">Seems msan is unhappy about the thread != nullptr   in line 81  of  jfrThreadLocal.cpp</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="en-DE"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="en-DE">  Thread* thread = Thread::current_or_null();</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="en-DE">  _parent_trace_id = thread != nullptr ? jvm_thread_id(thread) : (traceid)0;</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="en-DE"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="en-DE">Not sure why this is reported as  uninitialized ?</span><o:p></o:p></p>
</blockquote>
<p>I have no idea.<o:p></o:p></p>
<p>Did you pursue this any further, or did you give up?<o:p></o:p></p>
<p>/Magnus<o:p></o:p></p>
</div>
</body>
</html>