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

Unable to build with ASAN using gcc

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Dev Platform 2021-06-28

      Following the instructions here, I attempted to build the server with the address/leak sanitizers using gcc with the following invocation:

      ./buildscripts/scons.py --modules= --dbg=off --opt=on --link-model=dynamic --variables-files=etc/scons/mongodbtoolchain_stable_gcc.vars --allocator=system --sanitize=address
      

      And got the following error from SCONS:

      Checking if C compiler supports -fsanitize=address... yes
      KeyError: 'LLVM_SYMBOLIZER':
        File "/home/ubuntu/mongo/SConstruct", line 4544:
          env = doConfigure( env )
        File "/home/ubuntu/mongo/SConstruct", line 3618:
          if env['LLVM_SYMBOLIZER']:
        File "/home/ubuntu/mongo/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py", line 405:
          return self._dict[key]
      

      This issue persisted after trying to set a shell env var for LLVM_SYMBOLIZER:

      export LLVM_SYMBOLIZER='/opt/mongodbtoolchain/v3/bin/llvm-symbolizer'
      

      Ultimately I got around this by building with ASAN using Clang (thanks acm!), using an identical SCONS invocation to the one above except with the Clang variables instead of the GCC ones. But there appears to be an issue with building with ASAN and gcc.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            george.wangensteen@mongodb.com George Wangensteen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: