<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
span.EmailStyle19
{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: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="#0563C1" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="en-DE">Hi Stefan, not sure if this is the cause of the issue. If I add a check with a guarantee and build/run without ubsan<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 style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#172B4D;background:white">@@ -46,6 +46,9 @@ bool LogSelectionList::verify_selections(outputStream* out) const {</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#172B4D"><br>
<span style="background:white"> _selections[i].describe_tags_on(out);</span><br>
<span style="background:white"> out->print(". ");</span><br>
<span style="background:white"> </span><br>
<span style="background:white">+ // added - check that the array entries are okay</span><br>
<span style="background:white">+ _selections[i].check_for_bad_tag_array(i, out);</span><br>
<span style="background:white">+</span><br>
<span style="background:white"> _selections[i].suggest_similar_matching(out);</span></span><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">I see the large tag entry values too.<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">But initializing the whole _tags array seems to make sense.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="en-DE">What value should we write to the entries ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="en-DE">And any idea why the initialization was not done for some ?<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>
<p class="MsoNormal"><b><span lang="EN-US" style="mso-ligatures:none;mso-fareast-language:#2000">></span></b><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">>Isn't the problem that the LogSelection constructor doesn't initialize all elements (Only elements that are __NO_TAG gets initialized):<br>
>```<br>
>LogSelection::LogSelection(const LogTagType tags[LogTag::MaxTags], bool wildcard, LogLevelType level)<br>
> : _ntags(0), _wildcard(wildcard), _level(level), _tag_sets_selected(0) {<br>
> while (_ntags < LogTag::MaxTags && tags[_ntags] != LogTag::__NO_TAG) {<br>
> _tags[_ntags] = tags[_ntags];<br>
> _ntags++;<br>
> }<br>
>```<br>
><br>
>And then later when the code copies LogTagType arrays, it hits this ubsan warning when it reads the uninitialized value.. It looks like this could be fixed by always fully initializing _tags memory.<br>
<br>
<br>
<span style="mso-ligatures:none;mso-fareast-language:#2000"><o:p></o:p></span></p>
</div>
</body>
</html>