Skip to content

build: propagate ASAN/TSAN flags down to cmake_external deps.#6196

Closed
htuch wants to merge 8 commits intoenvoyproxy:masterfrom
htuch:fix-bazelrc-san-2
Closed

build: propagate ASAN/TSAN flags down to cmake_external deps.#6196
htuch wants to merge 8 commits intoenvoyproxy:masterfrom
htuch:fix-bazelrc-san-2

Conversation

@htuch
Copy link
Member

@htuch htuch commented Mar 6, 2019

While we await a solution for bazel-contrib/rules_foreign_cc#154 (comment), this PR provides a
temporary workaround to get full ASAN/TSAN propagation as needed.

This continues #6061, which had accumulated too much
complicated merge history to work with after the recent gperftools/LuaJIT migration to
rules_foreign_cc.

Risk level: Low
Testing: --config=clang-{tsan,asan}. This is broken in the latest CI images due to the mismatched
linker/compiler flags we previously had been sending to cmake_external builds.

Signed-off-by: Harvey Tuch htuch@google.com

While we await a solution for bazel-contrib/rules_foreign_cc#154 (comment), this PR provides a
temporary workaround to get full ASAN/TSAN propagation as needed.

This continues envoyproxy#6061, which had accumulated too much
complicated merge history to work with after the recent gperftools/LuaJIT migration to
rules_foreign_cc.

Risk level: Low
Testing: --config=clang-{tsan,asan}. This is broken in the latest CI images due to the mismatched
  linker/compiler flags we previously had been sending to cmake_external builds.

Signed-off-by: Harvey Tuch <htuch@google.com>
@htuch
Copy link
Member Author

htuch commented Mar 6, 2019

OK, this is great, we don't need the gperftools patch after moving over to rules_foreign_cc 👍

@PiotrSikora
Copy link
Contributor

It looks that the Lua tests are failing with ASan/TSan, could you investigate? Though, the issue is most likely with Lua itself, and not with your changes, which only uncovered it.

@htuch
Copy link
Member Author

htuch commented Mar 6, 2019

@PiotrSikora I know, I'm digging into this now. I'm hoping I can figure out a way to workaround these Envoy side, if not upstream, in a timely way, this is blocker for the coverage work atm.

@PiotrSikora
Copy link
Contributor

@htuch another way to approach this, assuming Lua issues are going to take more than a day or two to resolve, is to temporarily exclude Lua tests from ASan and TSan runs, since this PR is an improvement, all things considered, and it's not the reason for the breakage.

htuch added a commit to htuch/envoy that referenced this pull request Mar 6, 2019
This is needed to unblock envoyproxy#6196 while
libevent/libevent#741 (and consequently
envoyproxy#6083) go unresolved.

It's not particularly wonderful, but it will allow us to make progress independent of the libevent
work.

Risk level: Low
Testing: TSAN runs with envoyproxy#6196.

Signed-off-by: Harvey Tuch <htuch@google.com>
@lizan
Copy link
Member

lizan commented Mar 7, 2019

or blacklist Lua itself from being instrumented by ASAN? https://github.com/google/sanitizers/wiki/AddressSanitizer#turning-off-instrumentation

htuch added a commit that referenced this pull request Mar 7, 2019
This is needed to unblock #6196 while
libevent/libevent#741 (and consequently
#6083) go unresolved.

It's not particularly wonderful, but it will allow us to make progress independent of the libevent
work.

Risk level: Low
Testing: TSAN runs with #6196.

Signed-off-by: Harvey Tuch <htuch@google.com>
@htuch
Copy link
Member Author

htuch commented Mar 7, 2019

@lizan I think I'll blacklist, I've been looking at these errors and there are a few different varieties. We need someone to spend some serious time looking at this, it's not a high priority right now for us though.

Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
htuch added 2 commits March 7, 2019 16:09
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
@htuch
Copy link
Member Author

htuch commented Mar 7, 2019

Sigh, now we have some unrelated LSAN issue with host protoc, I guess we can disable LSAN but not sure why it started happening now..

@lizan
Copy link
Member

lizan commented Mar 7, 2019

@htuch I see that on some other PRs as well, so it might not directly related to this PR. Could be some docker capabilities issue with Circle.

/retest

@repokitteh-read-only
Copy link

🔨 rebuilding ci/circleci: asan (failed build)

🐱

Caused by: a #6196 (comment) was created by @lizan.

see: more, trace.

Signed-off-by: Harvey Tuch <htuch@google.com>
@htuch
Copy link
Member Author

htuch commented Mar 7, 2019

@lizan I think I have a fix based on what you did for LuaJIT. This should hopefully help other PRs.

@lizan
Copy link
Member

lizan commented Mar 8, 2019

@htuch seems it didn't help, LeakSanitizer has encountered a fatal error is probably something that LSAN bug or LSAN itself couldn't recover... I'm not sure why protoc is build with ASAN, as the flags are not set to host_cflags, no?

@htuch
Copy link
Member Author

htuch commented Mar 8, 2019

@lizan I don't think there is a clear split of host/target in https://github.com/protocolbuffers/protobuf/blob/master/BUILD. I will continue to investigate in this PR.

Signed-off-by: Harvey Tuch <htuch@google.com>
@stale
Copy link

stale bot commented Mar 15, 2019

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Mar 15, 2019
@stale
Copy link

stale bot commented Mar 22, 2019

This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot closed this Mar 22, 2019
@lizan lizan mentioned this pull request Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale stalebot believes this issue/PR has not been touched recently

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants