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

Building with ninja + ASan poisons the build/install/ directory

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0, 4.4.7
    • Affects Version/s: None
    • Component/s: Build
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Dev Platform 2021-02-08, Dev Platform 2021-02-22, Dev Platform 2021-03-08, Dev Platform 2021-03-22, Dev Platform 2021-04-05

      I use the following two SCons invocations to generate ninja files.

      python ./buildscripts/scons.py --modules= --dbg=off --opt=on --link-model=dynamic --variables-files=./etc/scons/mongodbtoolchain_stable_gcc.vars --ninja generate-ninja ICECC=icecc CCACHE=ccache
      python ./buildscripts/scons.py --modules= --dbg=on --opt=on --link-model=dynamic --variables-files=./etc/scons/mongodbtoolchain_stable_clang.vars --ninja generate-ninja ICECC=icecc CCACHE=ccache --sanitize=address --allocator=system NINJA_PREFIX=asan VARIANT_DIR=asandebug
      

      I find that I must delete the contents of the build/install/ directory when switching from an ASan build to a non-ASan build.

      $ rm -rf build/install/*
      $ ninja -f build.ninja -j 200 build/install/bin/wt
      [21/21 (100%) 0.033s] Install build/install/bin/wt
      $ ninja -f asan.ninja -j 200 build/install/bin/wt
      [14/14 (100%) 0.081s] Install build/install/bin/wt
      $ ninja -f build.ninja -j 200 build/install/bin/wt
      [10/10 (100%) 0.055s] Install build/install/bin/wt
      $ ./build/install/bin/wt
      ./build/install/bin/wt: symbol lookup error: /home/ubuntu/mongo/build/install/bin/../lib/libshim_allocator.so: undefined symbol: __asan_init
      

      (Using the wt tool as an example here because it compiles quickly.)

            Assignee:
            daniel.moody@mongodb.com Daniel Moody
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: