<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - parseSystemVersionPList assumes three numbers in the version number"
   href="https://bugs.llvm.org/show_bug.cgi?id=47918">47918</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>parseSystemVersionPList assumes three numbers in the version number
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>avi@drissman.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In an (non-public) Chromium bug, <a href="https://crbug.com/1138707">https://crbug.com/1138707</a>, we see a crash in
parseSystemVersionPList on macOS Big Sur:

std::__1::__throw_out_of_range(char const*) + stdexcept:0
abort_message + abort_message.cpp:32
parseSystemVersionPList + 
extensions::CpuInfoProvider::QueryInfo() + cpu_info_provider.cc:44

The `extensions` code is from Chromium; parseSystemVersionPList appears to be
the version from LLVM’s compiler-rt/lib/builtins/os_version_check.c.

If we look at the implementation of parseSystemVersionPList on LLVM ToT we see
(<a href="https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/builtins/os_version_check.c#L193">https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/builtins/os_version_check.c#L193</a>):

  sscanf(VersionStr, "%d.%d.%d", &GlobalMajor, &GlobalMinor, &GlobalSubminor);

It’s parsing the field “ProductVersion” from
/System/Library/CoreServices/SystemVersion.plist. If we look at that file on
Big Sur (20A5395g in this case) we see:

        <key>ProductVersion</key>
        <string>11.0</string>

and there are only two numbers and one period.

I can’t say with 100% certainty that it is that specific line, but something
appears to occasionally crash Chromium on Big Sur inside a compiler-added
parseSystemVersionPList() call.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>