Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-50125

UBSAN with ccache doesn't always respect -fsanitize-blacklist options

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7.0, 4.4.2
    • Component/s: Build
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.4
    • Sprint:
      Dev Platform 2020-08-24, Dev Platform 2020-09-07

      Description

      When I build the server on my evergreen workstation with AUBSAN, it crashes with messages like the following:

      {"t":{"$date":"2020-08-05T14:10:35.751+00:00"},"s":"I",  "c":"RECOVERY", "id":23987,   "ctx":"initandlisten","msg":"WiredTiger recoveryTimestamp","attr":{"recoveryTimestamp":{"$timestamp":{"t":0,"i":0}}}}
      src/third_party/murmurhash3/MurmurHash3.cpp:92:49: runtime error: addition of unsigned offset to 0x7ffe6ba480d0 overflowed to 0x7ffe6ba480c0
      SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/third_party/murmurhash3/MurmurHash3.cpp:92:49 in
      

      I've also seen messages from Snappy. These errors are surprising, as they're in files covered by etc/ubsan.blacklist which I would expect to suppress them. On a hunch, I tried disabling ccache, and the resulting mongod binaries appear to work. I found this Github issue which appears to describe the problem: https://github.com/ccache/ccache/issues/174 It was tagged as being a part of their 3.5 epic. The version of ccache on the evergreen workstations appears to be version 3.4.1.

      The SCons invokation which produced the failing binaries:

      python ./buildscripts/scons.py --dbg=on --opt=on --variables-files=etc/scons/mongodbtoolchain_v3_clang.vars --allocator=system --sanitize=address,undefined --ninja=next generate-ninja MONGO_VERSION="0.0.0" MONGO_GIT_HASH="unknown" CCACHE=ccache
      

      The corrected invokation:

      python ./buildscripts/scons.py --dbg=on --opt=on --variables-files=etc/scons/mongodbtoolchain_v3_clang.vars --allocator=system --sanitize=address,undefined --ninja=next generate-ninja MONGO_VERSION="0.0.0" MONGO_GIT_HASH="unknown"
      

        Attachments

          Activity

            People

            Assignee:
            ryan.egesdahl Ryan Egesdahl
            Reporter:
            spencer.jackson Spencer Jackson
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: