https://bugs.llvm.org/show_bug.cgi?id=47918

            Bug ID: 47918
           Summary: parseSystemVersionPList assumes three numbers in the
                    version number
           Product: compiler-rt
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
          Assignee: unassignedb...@nondot.org
          Reporter: a...@drissman.com
                CC: llvm-bugs@lists.llvm.org

In an (non-public) Chromium bug, https://crbug.com/1138707, 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
(https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/builtins/os_version_check.c#L193):

  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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to