• Bruce Dawson's avatar
    Work around VC++ code-ben bug 804884 · 4f4f08c9
    Bruce Dawson authored
    VC++ PGO builds crash deep inside memmove, as called by
    message_center::InnerBoundedLabel::GetSizeForWidthAndLines which calls
    base::JoinString and then ultimately basic_string<>::append and memmove.
    Inspection of the stack and the generated code shows that
    base::JoinString is called correctly but that base::JoinString (or the
    inlined JoinStringT and three other levels of inlining) fail to read
    separator off the stack correctly - they read it from an address that is
    four bytes too early. This leads to copying too many bytes from the
    wrong address.
    
    Fully disabling optimizations in VC++ builds for the affected function
    seems like the right fix. If time permits then a reduction and VC++ bug
    will be created. However if this is a PGO-only bug then...
    
    Bug: 804884
    Change-Id: I80fd8e693a35b26a386cd99a1b17c54bede95d5c
    Reviewed-on: https://chromium-review.googlesource.com/891569Reviewed-by: default avatarNico Weber <thakis@chromium.org>
    Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#532658}
    4f4f08c9
string_util.cc 37.2 KB