<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    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>
    StefanK<br>
    <br>
    <div class="moz-cite-prefix">On 2024-09-25 13:23, Baesken, Matthias
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:AM9PR02MB67701F956528983F7DBF19F693692@AM9PR02MB6770.eurprd02.prod.outlook.com">
      
      <meta name="Generator" content="Microsoft Word 15 (filtered medium)">
      <style>@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;}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;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        mso-fareast-language:EN-US;}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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span lang="EN-US">Hi,  it has been
            observed (with ubsan,  and also without when adding a little
            check + guarantee)  that in logSelection.cpp<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">  we run into very high
            / messed up  tag values :<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="en-DE"><a href="https://bugs.openjdk.org/browse/JDK-8333090" moz-do-not-send="true">[JDK-8333090] ubsan:
              logSelection.cpp:41:49: runtime error: load of value
              32597, which is not a valid value for type 'type' - Java
              Bug System (openjdk.org)</a><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">When running   jtreg
            tests  </span><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#172B4D;background:white" lang="en-DE">cds/appcds/LotsOfClasses  or 
            cds/appcds/cacheObject/ArchivedIntegerCacheTest  we see
            those high tag values .<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#172B4D;background:white" lang="en-DE">Is there someone more familiar with  UL  who
            has an idea  why the bad tag values occur ?<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#172B4D;background:white" lang="en-DE"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="en-DE">Or should / can we
            ignore those  because even bad/uninitialized values work
            “somehow”  ?<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</span><span lang="EN-US"><o:p></o:p></span></p>
      </div>
    </blockquote>
    <br>
  </body>
</html>