New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 610748 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jun 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

ASAN gdb_rsp_unittest is broken in GN

Project Member Reported by krasin@chromium.org, May 10 2016

Issue description

Per 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
 

Comment 1 by thakis@chromium.org, May 10 2016

As far as I know, asan has never worked in gn.

Comment 2 by krasin@chromium.org, May 10 2016

Labels: -Pri-1 Pri-2
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.

Comment 4 by krasin@chromium.org, May 11 2016

Blockedon: 605732
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.
Blockedon: -605732
Status: Fixed (was: Untriaged)
I reworked things and fixed this a different way ...

Comment 6 by krasin@chromium.org, Jun 21 2016

Thank you, Dirk!

Sign in to add a comment