[cfe-users] Errors when trying to use libcxx/libcxxabi with memory sanitizer

Evgenii Stepanov via cfe-users cfe-users at lists.llvm.org
Mon Nov 23 09:11:52 PST 2015

On Mon, Nov 23, 2015 at 12:59 AM, Schlottke-Lakemper, Michael via
cfe-users <cfe-users at lists.llvm.org> wrote:
> Hi folks,
> I'm trying to set up our cluster tool chain to support clang’s memory
> sanitizer for our multiphysics simulation program, but I can’t get it to
> work :-/
> I started with a regularly compiled clang installation (with libcxx,
> libcxxabi, and libomp built in-tree). With this, I compiled all necessary
> third-party libraries with “-O1 -fsanitize=memory” (OpenMPI, FFTW, Parallel
> netCDF). Then, I compiled the libcxx/libcxxabi libraries with msan-support
> by checking out the llvm source and the libcxx/libcxxabi repos into the
> llvm/projects/ directory. I configured them with LLVM_USE_SANITIZER=Memory
> and put the msan-instrumented libraries in the LD_LIBRARY_PATH.
> Finally, I tried to compile our tool, ZFS, with the memory sanitizer enabled
> and linked against the msan-compiled third-party libraries as well as the
> msan-instrumented libcxx/libcxxabi libraries (by putting them in the
> LD_LIBRARY_PATH). However, here I failed: either at configure time or at
> compile time (after doing some LD_LIBRARY_PATH trickery), clang exits with
> the following error:
> /pds/opt/llvm-20151121-r253770/bin/clang++: symbol lookup error:
> /pds/opt/libcxx-msan-20151121-r253770/lib/libc++abi.so.1: undefined symbol:
> __msan_va_arg_overflow_size_tls
> Any suggestions as to what I am doing wrong? Should I put the
> msan-instrumented libcxx in the LD_LIBRARY_PATH after compilation only?

Yes, probably. In this case your compiler, which is not built with
MSan, picked up an instrumented libc++abi.
Sometimes it is convenient to set RPATH on all msan
libraries/executables and avoid LD_LIBRARY_PATH.

> Thanks a lot in advance
> Michael
> --
> Michael Schlottke-Lakemper
> Chair of Fluid Mechanics and Institute of Aerodynamics
> RWTH Aachen University
> Wüllnerstraße 5a
> 52062 Aachen
> Germany
> Phone: +49 (241) 80 95188
> Fax: +49 (241) 80 92257
> Mail: m.schlottke-lakemper at aia.rwth-aachen.de
> Web: http://www.aia.rwth-aachen.de
> _______________________________________________
> cfe-users mailing list
> cfe-users at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

More information about the cfe-users mailing list