[PATCH] D76073: [compiler-rt][tsan] Fix: Leak of ThreadSignalContext memory mapping when destroying fibers.

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 20 10:17:25 PDT 2020


dvyukov added a comment.
Herald added a subscriber: ormris.

Hi Florian,

I am on the current HEAD (ce6c95aacae0cf5f8de8780de7f22de5f31a07dd <https://reviews.llvm.org/rGce6c95aacae0cf5f8de8780de7f22de5f31a07dd>), I applied this patch. But I am getting this error from 'ninja check-tsan`. Does it pass for you?

FAIL: ThreadSanitizer-x86_64 :: fiber_cleanup.cpp (199 of 400)

- TEST 'ThreadSanitizer-x86_64 :: fiber_cleanup.cpp' FAILED ********************

Script:
-------

: 'RUN: at line 1';      /home/dvyukov/src/llvm/build/./bin/clang  --driver-mode=g++ -fsanitize=thread -Wall  -m64   -gline-tables-only -I/home/dvyukov/src/llvm/compiler-rt/test/tsan/../ -std=c++11 -I/home/dvyukov/src/llvm/compiler-rt/test/tsan/../ -nostdinc++ -I/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1 -O1 /home/dvyukov/src/llvm/compiler-rt/test/tsan/fiber_cleanup.cpp -o /home/dvyukov/src/llvm/build/projects/compiler-rt/test/tsan/X86_64Config/Output/fiber_cleanup.cpp.tmp &&  /home/dvyukov/src/llvm/build/projects/compiler-rt/test/tsan/X86_64Config/Output/fiber_cleanup.cpp.tmp 2>&1 | FileCheck /home/dvyukov/src/llvm/compiler-rt/test/tsan/fiber_cleanup.cpp
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Exit Code: 1

Command Output (stderr):
------------------------

/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `count_memory_mappings()':
/home/dvyukov/src/llvm/compiler-rt/test/tsan/fiber_cleanup.cpp:14: undefined reference to `std::__1::to_string(int)'
/usr/bin/ld: /home/dvyukov/src/llvm/compiler-rt/test/tsan/fiber_cleanup.cpp:14: undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
/usr/bin/ld: /home/dvyukov/src/llvm/compiler-rt/test/tsan/fiber_cleanup.cpp:14: undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
/usr/bin/ld: /home/dvyukov/src/llvm/compiler-rt/test/tsan/fiber_cleanup.cpp:14: undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
/usr/bin/ld: /home/dvyukov/src/llvm/compiler-rt/test/tsan/fiber_cleanup.cpp:23: undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
/usr/bin/ld: /home/dvyukov/src/llvm/compiler-rt/test/tsan/fiber_cleanup.cpp:14: undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:/home/dvyukov/src/llvm/compiler-rt/test/tsan/fiber_cleanup.cpp:14: more undefined references to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()' follow
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `fiber_iteration()':
/home/dvyukov/src/llvm/compiler-rt/test/tsan/fiber_cleanup.cpp:33: undefined reference to `std::__1::mutex::lock()'
/usr/bin/ld: /home/dvyukov/src/llvm/compiler-rt/test/tsan/fiber_cleanup.cpp:34: undefined reference to `std::__1::mutex::unlock()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, char const*)':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/string:4250: undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*)'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&)':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/string:4233: undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::insert(unsigned long, char const*)'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::basic_ifstream<char, std::__1::char_traits<char> >::basic_ifstream(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int)':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/fstream:1231: undefined reference to `std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/fstream:1231: undefined reference to `std::__1::basic_ios<char, std::__1::char_traits<char> >::~basic_ios()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::basic_ifstream<char, std::__1::char_traits<char> >::~basic_ifstream()':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/iosfwd:144: undefined reference to `std::__1::basic_ios<char, std::__1::char_traits<char> >::~basic_ios()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::basic_ifstream<char, std::__1::char_traits<char> >::~basic_ifstream()':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/iosfwd:144: undefined reference to `std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::basic_filebuf<char, std::__1::char_traits<char> >::~basic_filebuf()':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/fstream:409: undefined reference to `std::__1::basic_streambuf<char, std::__1::char_traits<char> >::~basic_streambuf()'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/fstream:409: undefined reference to `std::__1::basic_streambuf<char, std::__1::char_traits<char> >::~basic_streambuf()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::codecvt<char, char, __mbstate_t> const& std::__1::use_facet<std::__1::codecvt<char, char, __mbstate_t> >(std::__1::locale const&)':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/__locale:250: undefined reference to `std::__1::codecvt<char, char, __mbstate_t>::id'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/__locale:250: undefined reference to `std::__1::locale::use_facet(std::__1::locale::id&) const'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::__throw_bad_cast()':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/typeinfo:345: undefined reference to `std::bad_cast::bad_cast()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::basic_ios<char, std::__1::char_traits<char> >::basic_ios()':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/ios:675: undefined reference to `vtable for std::__1::basic_ios<char, std::__1::char_traits<char> >'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/ios:675: undefined reference to `vtable for std::__1::basic_ios<char, std::__1::char_traits<char> >'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::basic_filebuf<char, std::__1::char_traits<char> >::basic_filebuf()':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/fstream:213: undefined reference to `std::__1::basic_streambuf<char, std::__1::char_traits<char> >::basic_streambuf()'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/fstream:305: undefined reference to `std::__1::locale::~locale()'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/fstream:307: undefined reference to `std::__1::locale::~locale()'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/fstream:307: undefined reference to `std::__1::locale::~locale()'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/fstream:311: undefined reference to `std::__1::basic_streambuf<char, std::__1::char_traits<char> >::~basic_streambuf()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::ios_base::ios_base()':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/ios:344: undefined reference to `vtable for std::__1::ios_base'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/ios:344: undefined reference to `vtable for std::__1::ios_base'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::basic_ios<char, std::__1::char_traits<char> >::init(std::__1::basic_streambuf<char, std::__1::char_traits<char> >*)':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/ios:712: undefined reference to `std::__1::ios_base::init(void*)'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `bool std::__1::has_facet<std::__1::codecvt<char, char, __mbstate_t> >(std::__1::locale const&)':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/__locale:242: undefined reference to `std::__1::codecvt<char, char, __mbstate_t>::id'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/__locale:242: undefined reference to `std::__1::locale::has_facet(std::__1::locale::id&) const'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::basic_streambuf<char, std::__1::char_traits<char> >::getloc() const':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/streambuf:149: undefined reference to `std::__1::locale::locale(std::__1::locale const&)'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::ios_base::setstate(unsigned int)':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/ios:548: undefined reference to `std::__1::ios_base::clear(unsigned int)'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::basic_istream<char, std::__1::char_traits<char> >& std::__1::getline<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_istream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, char)':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/istream:1511: undefined reference to `std::__1::basic_istream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_istream<char, std::__1::char_traits<char> >&, bool)'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/istream:1532: undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::push_back(char)'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::basic_ios<char, std::__1::char_traits<char> >::widen(char) const':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/ios:778: undefined reference to `std::__1::ios_base::getloc() const'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/ios:778: undefined reference to `std::__1::locale::~locale()'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/ios:778: undefined reference to `std::__1::locale::~locale()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o: in function `std::__1::ctype<char> const& std::__1::use_facet<std::__1::ctype<char> >(std::__1::locale const&)':
/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/__locale:250: undefined reference to `std::__1::ctype<char>::id'
/usr/bin/ld: /home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1/__locale:250: undefined reference to `std::__1::locale::use_facet(std::__1::locale::id&) const'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:(.rodata._ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE[_ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE]+0x10): undefined reference to `typeinfo for std::__1::basic_istream<char, std::__1::char_traits<char> >'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:(.rodata._ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE[_ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE]+0x18): undefined reference to `std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:(.rodata._ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE[_ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE]+0x20): undefined reference to `std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:(.rodata._ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE[_ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE]+0x38): undefined reference to `typeinfo for std::__1::basic_istream<char, std::__1::char_traits<char> >'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:(.rodata._ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE[_ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE]+0x40): undefined reference to `virtual thunk to std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:(.rodata._ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE[_ZTCNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE]+0x48): undefined reference to `virtual thunk to std::__1::basic_istream<char, std::__1::char_traits<char> >::~basic_istream()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:(.rodata._ZTINSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE[_ZTINSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE]+0x10): undefined reference to `typeinfo for std::__1::basic_istream<char, std::__1::char_traits<char> >'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:(.rodata._ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE[_ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE]+0x48): undefined reference to `std::__1::basic_streambuf<char, std::__1::char_traits<char> >::showmanyc()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:(.rodata._ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE[_ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE]+0x50): undefined reference to `std::__1::basic_streambuf<char, std::__1::char_traits<char> >::xsgetn(char*, long)'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:(.rodata._ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE[_ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE]+0x60): undefined reference to `std::__1::basic_streambuf<char, std::__1::char_traits<char> >::uflow()'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:(.rodata._ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE[_ZTVNSt3__113basic_filebufIcNS_11char_traitsIcEEEE]+0x70): undefined reference to `std::__1::basic_streambuf<char, std::__1::char_traits<char> >::xsputn(char const*, long)'
/usr/bin/ld: /tmp/fiber_cleanup-0ec261.o:(.rodata._ZTINSt3__113basic_filebufIcNS_11char_traitsIcEEEE[_ZTINSt3__113basic_filebufIcNS_11char_traitsIcEEEE]+0x10): undefined reference to `typeinfo for std::__1::basic_streambuf<char, std::__1::char_traits<char> >'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

: 'RUN: at line 1';      /home/dvyukov/src/llvm/build/./bin/clang  --driver-mode=g++ -fsanitize=thread -Wall  -m64   -gline-tables-only -I/home/dvyukov/src/llvm/compiler-rt/test/tsan/../ -std=c++11 -I/home/dvyukov/src/llvm/compiler-rt/test/tsan/../ -nostdinc++ -I/home/dvyukov/src/llvm/build/projects/compiler-rt/lib/tsan/libcxx_tsan_x86_64/include/c++/v1 -O1 /home/dvyukov/src/llvm/compiler-rt/test/tsan/inlined_memcpy_race.cpp -o /home/dvyukov/src/llvm/build/projects/compiler-rt/test/tsan/X86_64Config/Output/inlined_memcpy_race.cpp.tmp && /home/dvyukov/src/llvm/compiler-rt/test/tsan/deflake.bash 10  /home/dvyukov/src/llvm/build/projects/compiler-rt/test/tsan/X86_64Config/Output/inlined_memcpy_race.cpp.tmp 2>&1 | FileCheck /home/dvyukov/src/llvm/compiler-rt/test/tsan/inlined_memcpy_race.cpp
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76073/new/

https://reviews.llvm.org/D76073





More information about the llvm-commits mailing list