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

ASAN builds on evergreen virtual workstation (gcc only)

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Build

      shm_open and shm_unlink are in library -lrt.
      When ASAN is enabled, the Scons openssl configuration stage needs libasan, which needs librt, which isn't in the link for that tiny C probe program.

      If I add LIBS=rt to my scons line, I can build executables.
      Unfortunately those executables can't run because asan is complaining that it needs libasan to be first in the dynamic link order or something. Still drilling into that.

      But it looks like we can't quite make asan executables out of the box, and we intend to be able to do that. Just running them on Evergreen isn't sufficient for debugging.

      $ uname -a
      Linux ip-10-122-8-67 5.4.0-1084-aws #91~18.04.1-Ubuntu SMP Sun Aug 14 01:24:43 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
      
      
      $ /home/ubuntu/mongo-dev/work/mongo-vscode/python3-venv/bin/python3 buildscripts/scons.py VARIANT_DIR=dynamic_gcc_asan MONGO_GIT_HASH=unknown LLVM_SYMBOLIZER=/opt/mongodbtoolchain/v3/bin/llvm-symbolizer --opt=on CCACHE=ccache ICECC=icecc --ninja=enabled VERBOSE=1 --link-model=dynamic --variables-files=etc/scons/mongodbtoolchain_stable_gcc.vars --sanitize=address --allocator=system --modules=enterprise generate-ninja
       
      file /home/ubuntu/mongo-dev/work/mongo-vscode/SConstruct,line 4576:
              Configure(confdir = build/scons/dynamic_gcc_asan/sconf_temp)
      scons: Configure: Checking for SSLeay_version(0) in C library crypto... 
      build/scons/dynamic_gcc_asan/sconf_temp/conftest_d6743137aeb7fb2674cc9632f9989034_0.c <-
        |
        |
        |#include "openssl/crypto.h"
        |
        |int
        |main() {
        |  SSLeay_version(0);
        |return 0;
        |}
        |
      /opt/mongodbtoolchain/v3/bin/gcc -o build/scons/dynamic_gcc_asan/sconf_temp/conftest_d6743137aeb7fb2674cc9632f9989034_0.o -c -std=c11 -Werror -ffp-contract=off -fasynchronous-unwind-tables -ggdb -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -fno-omit-frame-pointer -fno-strict-aliasing -O2 -march=sandybridge -mtune=generic -mprefer-vector-width=128 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-const-variable -Wno-unused-but-set-variable -Wno-missing-braces -fstack-protector-strong -fsanitize=address -fno-omit-frame-pointer -Wa,--nocompress-debug-sections -fno-builtin-memcmp -fPIE -DMONGO_USE_VISIBILITY -DNDEBUG -D_XOPEN_SOURCE=700 -D_GNU_SOURCE -DADDRESS_SANITIZER -D_FORTIFY_SOURCE=2 build/scons/dynamic_gcc_asan/sconf_temp/conftest_d6743137aeb7fb2674cc9632f9989034_0.c
      /opt/mongodbtoolchain/v3/bin/gcc -o build/scons/dynamic_gcc_asan/sconf_temp/conftest_d6743137aeb7fb2674cc9632f9989034_0_49a9d12433e36832ac7cd10084eabe88 -Wl,--fatal-warnings -Wl,--no-as-needed -pthread -Wl,-z,now -fuse-ld=gold -fstack-protector-strong -fsanitize=address -pie -rdynamic build/scons/dynamic_gcc_asan/sconf_temp/conftest_d6743137aeb7fb2674cc9632f9989034_0.o -lm -lresolv -ldl -lcrypto
      /opt/mongodbtoolchain/revisions/549e9c72ce95de436fb83815796d54a47893c049/stow/gcc-v3.ePh/lib/gcc/x86_64-mongodb-linux/8.5.0/libasan.a(sanitizer_posix_libcdep.o):function __sanitizer::GetNamedMappingFd(char const*, unsigned long): error: undefined reference to 'shm_open'
      /opt/mongodbtoolchain/revisions/549e9c72ce95de436fb83815796d54a47893c049/stow/gcc-v3.ePh/lib/gcc/x86_64-mongodb-linux/8.5.0/libasan.a(sanitizer_posix_libcdep.o):function __sanitizer::GetNamedMappingFd(char const*, unsigned long): error: undefined reference to 'shm_unlink'
      collect2: error: ld returned 1 exit status
      scons: Configure: no
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: