Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug builds under clang/llvm sanitizers #443

Closed
htuch opened this issue Feb 7, 2017 · 4 comments
Closed

Debug builds under clang/llvm sanitizers #443

htuch opened this issue Feb 7, 2017 · 4 comments
Assignees
Milestone

Comments

@htuch
Copy link
Member

htuch commented Feb 7, 2017

Currently Envoy builds under g++ and can optionally be run under AddressSanitizer via do_ci.sh. There are other sanitizers provided by LLVM such as msan and tsan (see https://github.com/google/sanitizers) that could be automatically applied and run during presubmits to increase confidence in code correctness if we could perform a clang/llvm debug build.

@mattklein123
Copy link
Member

Per gitter discussion, this sounds good to me. The main issue right now is travis is terrible, and we already do 4 builds. We should probably get crisp about how many builds we want to do and define the optimal matrix.

@mattklein123
Copy link
Member

@htuch just dropping note here per our private discussion. We need to reconcile what version of clang we can reasonably use since google internal clang != public clang without some work. Needs investigation.

@htuch
Copy link
Member Author

htuch commented May 5, 2017

MSAN isn't going to be easy, and probably not worth doing in our current CI environment. You basically need to rebuild lib[std]c++ and all external deps, see https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo. I tried it without this and I see false positives such as:

Uninitialized bytes in __interceptor_strlen at offset 18 inside [0x703000000168, 19)
==7==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7fe5d4e5d5ce  (/google/src/files/151379707/depot/google3/third_party/crosstool/v18/llvm_unstable/toolchain/x86_64-grtev4-linux-gnu/lib64/libstdc++.so.6+0xc75ce)
    #1 0x44f11cb  (/usr/local/google/home/htuch/.cache/bazel/_bazel_htuch/89676793239ac96d94294e6c7a44597f/execroot/envoy/bazel-out/local-dbg/bin/test/config_test/example_configs_test+0x44f11cb)
    #2 0x4501720  (/usr/local/google/home/htuch/.cache/bazel/_bazel_htuch/89676793239ac96d94294e6c7a44597f/execroot/envoy/bazel-out/local-dbg/bin/test/config_test/example_configs_test+0x4501720)
    #3 0x44e7048  (/usr/local/google/home/htuch/.cache/bazel/_bazel_htuch/89676793239ac96d94294e6c7a44597f/execroot/envoy/bazel-out/local-dbg/bin/test/config_test/example_configs_test+0x44e7048)
    #4 0x427c0a  (/usr/local/google/home/htuch/.cache/bazel/_bazel_htuch/89676793239ac96d94294e6c7a44597f/execroot/envoy/bazel-out/local-dbg/bin/test/config_test/example_configs_test+0x427c0a)
    #5 0x427e91  (/usr/local/google/home/htuch/.cache/bazel/_bazel_htuch/89676793239ac96d94294e6c7a44597f/execroot/envoy/bazel-out/local-dbg/bin/test/config_test/example_configs_test+0x427e91)
    #6 0x452d97d  (/usr/local/google/home/htuch/.cache/bazel/_bazel_htuch/89676793239ac96d94294e6c7a44597f/execroot/envoy/bazel-out/local-dbg/bin/test/config_test/example_configs_test+0x452d97d)
    #7 0x7fe5d3db4cfe  (/usr/grte/v4/lib64/libc.so.6+0x38cfe)
    #8 0x639438  (/usr/local/google/home/htuch/.cache/bazel/_bazel_htuch/89676793239ac96d94294e6c7a44597f/execroot/envoy/bazel-out/local-dbg/bin/test/config_test/example_configs_test+0x639438)

  Uninitialized value was created by a heap allocation
    #0 0x6a86e9  (/usr/local/google/home/htuch/.cache/bazel/_bazel_htuch/89676793239ac96d94294e6c7a44597f/execroot/envoy/bazel-out/local-dbg/bin/test/config_test/example_configs_test+0x6a86e9)
    #1 0x7fe5d4e5d668  (/google/src/files/151379707/depot/google3/third_party/crosstool/v18/llvm_unstable/toolchain/x86_64-grtev4-linux-gnu/lib64/libstdc++.so.6+0xc7668)
    #2 0x427c0a  (/usr/local/google/home/htuch/.cache/bazel/_bazel_htuch/89676793239ac96d94294e6c7a44597f/execroot/envoy/bazel-out/local-dbg/bin/test/config_test/example_configs_test+0x427c0a)
    #3 0x427e91  (/usr/local/google/home/htuch/.cache/bazel/_bazel_htuch/89676793239ac96d94294e6c7a44597f/execroot/envoy/bazel-out/local-dbg/bin/test/config_test/example_configs_test+0x427e91)
    #4 0x452d97d  (/usr/local/google/home/htuch/.cache/bazel/_bazel_htuch/89676793239ac96d94294e6c7a44597f/execroot/envoy/bazel-out/local-dbg/bin/test/config_test/example_configs_test+0x452d97d)
    #5 0x7fe5d3db4cfe  (/usr/grte/v4/lib64/libc.so.6+0x38cfe)
    #6 0x639438  (/usr/local/google/home/htuch/.cache/bazel/_bazel_htuch/89676793239ac96d94294e6c7a44597f/execroot/envoy/bazel-out/local-dbg/bin/test/config_test/example_configs_test+0x639438)

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/google/src/files/151379707/depot/google3/third_party/crosstool/v18/llvm_unstable/toolchain/x86_64-grtev4-linux-gnu/lib64/libstdc++.so.6+0xc75ce) 

TSAN/ASAN work fine though with clang-5.0.

htuch added a commit to htuch/envoy that referenced this issue May 7, 2017
* Add --config={clang-asan,clang-tsan} configuration option to Bazel CLI for when building with
  clang-5.0.

* Add clang-asan, which also checks some static initialization order stuff.

* Add ubsan to asan/clang-asan configs, the two play nicely together.

* Switch bazel.asan from gcc-4.9+asan to clang-5.0+clang-asan.

* Add bazel.tsan CI target, enabled in .travis.yml.

MSAN is not included due to the issue discussed at envoyproxy#443.
htuch added a commit that referenced this issue May 7, 2017
* Add --config={clang-asan,clang-tsan} configuration option to Bazel CLI for when building with
  clang-5.0.

* Add clang-asan, which also checks some static initialization order stuff.

* Add ubsan to asan/clang-asan configs, the two play nicely together.

* Switch bazel.asan from gcc-4.9+asan to clang-5.0+clang-asan.

* Add bazel.tsan CI target, enabled in .travis.yml.

MSAN is not included due to the issue discussed at #443.
@htuch
Copy link
Member Author

htuch commented May 7, 2017

The remaining work on MSAN is now tracked in #918.

@htuch htuch closed this as completed May 7, 2017
rshriram pushed a commit to rshriram/envoy that referenced this issue Oct 30, 2018
jpsim pushed a commit that referenced this issue Nov 28, 2022
Description: Consumes OS network preference signals to classify connections based on when they're created. New streams will be opened on connections grouped under the current network indication. Note that sockets are still opened by syscalls and so it is simply assumed they are attached to the appropriate network interface.
Risk Level: Moderate
Testing: Local testing

Co-authored-by: Jose Nino <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: JP Simard <[email protected]>
jpsim pushed a commit that referenced this issue Nov 29, 2022
Description: Consumes OS network preference signals to classify connections based on when they're created. New streams will be opened on connections grouped under the current network indication. Note that sockets are still opened by syscalls and so it is simply assumed they are attached to the appropriate network interface.
Risk Level: Moderate
Testing: Local testing

Co-authored-by: Jose Nino <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: JP Simard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants