ASAN gdb_rsp_unittest is broken in GN |
||||
Issue descriptionPer user report [1], ASAN was recently broken in GN. I reproduced that: $ gn gen //out/gn '--args=is_asan=true is_debug=false' --check $ ninja -C out/gn-asan gdb_rsp_unittest ... FAILED: gdb_rsp_unittest ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -B../../third_party/binutils/Linux_x64/Release/bin -fuse-ld=gold -pthread -m64 -Wl, -O1 -Wl,--gc-sections --sysroot=../../build/linux/debian_wheezy_amd64-sysroot -fsanitize=address -Wl,-rpath-link=../gn-asan -Wl,--disable-new-dtags -Wl,-rpath=\$ORIGIN/. -Wl,-rpath-link=. -o "./gdb_rsp_unittes t" -Wl,--start-group @"./gdb_rsp_unittest.rsp" -Wl,--end-group -ldl -lrt ../../native_client/src/trusted/debug_stub/packet_test.cc:98: error: undefined reference to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()' ../../buildtools/third_party/libc++/trunk/include/string:3833: error: undefined reference to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(unsigned long, unsign ed long, char const*, unsigned long) const' ../../buildtools/third_party/libc++/trunk/include/string:3833: error: undefined reference to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(unsigned long, unsign ed long, char const*, unsigned long) const' ../../native_client/src/trusted/debug_stub/session_test.cc:268: error: undefined reference to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()' ../../buildtools/third_party/libc++/trunk/include/vector:962: error: undefined reference to 'std::__1::__vector_base_common<true>::__throw_length_error() const' ../../buildtools/third_party/libc++/trunk/include/string:2027: error: undefined reference to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)' ../../native_client/src/trusted/debug_stub/util_test.cc:73: error: undefined reference to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()' ../../native_client/src/trusted/debug_stub/util_test.cc:73: error: undefined reference to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()' ../../buildtools/third_party/libc++/trunk/include/string:2027: error: undefined reference to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)' ../../buildtools/third_party/libc++/trunk/include/string:2027: error: undefined reference to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)' ../../buildtools/third_party/libc++/trunk/include/string:1398: error: undefined reference to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*)' ../../buildtools/third_party/libc++/trunk/include/ios:673: error: undefined reference to 'std::__1::ios_base::init(void*)' ... The ASAN bot is green, but it's based on GYP: https://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Builder We need to fix ASAN in GN, and probably convert the bot to GN. 1. https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/EvDzuMBAaIk
,
May 10 2016
I guess, it's time to make it working :) But yeah, if it's not a recent regression, I probably lower the priority a bit.
,
May 11 2016
The fix is out: https://codereview.chromium.org/1964203003/
,
May 11 2016
After discussing this issue with mseaborn@ and eugenis@, it seems that the root cause for this issue is that every executable target has to opt into using //build/config/sanitizers:deps. There're more than 80 targets which do this: https://code.google.com/p/chromium/codesearch#search/&q=build/config/sanitizers:deps%20file:%5C.gn&sq=package:chromium&type=cs The proper fix would be to implicitly add this dependency to every executable target in src/build/config/BUILDCONFIG.gn. In fact, this dependency is already added to all components. The fix is tricky and I will probably wait until ASAN bots are converted to GN to make sure I don't introduce any regression.
,
Jun 21 2016
I reworked things and fixed this a different way ...
,
Jun 21 2016
Thank you, Dirk! |
||||
►
Sign in to add a comment |
||||
Comment 1 by thakis@chromium.org
, May 10 2016