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

Clang msan support #918

Closed
htuch opened this issue May 7, 2017 · 6 comments
Closed

Clang msan support #918

htuch opened this issue May 7, 2017 · 6 comments
Assignees
Labels
area/build no stalebot Disables stalebot from closing an issue

Comments

@htuch
Copy link
Member

htuch commented May 7, 2017

Clang ASAN/TSAN support was introduced under #443 and #904.

MSAN isn't going to be easy, and questionably 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) 

We should consider adding this when we have better CI resourcing for dynamically rebuilding all libraries (so we don't need to bloat the Docker CI image).

@dnoe
Copy link
Contributor

dnoe commented Sep 18, 2017

We should consider doing this again now that we are under CNCF and have access to more CI resources. MSAN has found a few bugs internally that would have been caught by CI before merging.

@keith
Copy link
Member

keith commented Apr 6, 2022

It seems like a lot has changed since this issue originated, I see some configuration for msan on CI and a few bazel configs for it, has anyone tried this recently? I'm curious about how many false positives we would find

@keith
Copy link
Member

keith commented Apr 6, 2022

It looks like at this point libc++ is setup correctly for this at least envoyproxy/envoy-build-tools@f741613

@htuch htuch removed the help wanted Needs help! label Apr 6, 2022
@github-actions
Copy link

github-actions bot commented May 6, 2022

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label May 6, 2022
@htuch htuch added no stalebot Disables stalebot from closing an issue and removed stale stalebot believes this issue/PR has not been touched recently labels May 9, 2022
@keith
Copy link
Member

keith commented May 9, 2022

Given this test PR #20680 I think we could probably enable this on CI, starting with an opt out list of places that need to be investigated, but it might be too many violations to be ready for prime time.

@lizan
Copy link
Member

lizan commented May 19, 2022

#21348

@lizan lizan closed this as completed May 19, 2022
jpsim pushed a commit that referenced this issue Nov 28, 2022
Fixing android's api to 29 since it seems like api 30 has some bazel proguard issues which are similar to: bazelbuild/bazel#3777

For an explanation of how to fill out the fields, please see the relevant section
in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/master/PULL_REQUESTS.md)

Description: android: fixate api_level to be 29
Risk Level: low
Testing: ci
Docs Changes: n/a
Release Notes: n/a
[Optional Fixes #Issue]
[Optional Deprecated:]

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this issue Nov 29, 2022
Fixing android's api to 29 since it seems like api 30 has some bazel proguard issues which are similar to: bazelbuild/bazel#3777

For an explanation of how to fill out the fields, please see the relevant section
in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/master/PULL_REQUESTS.md)

Description: android: fixate api_level to be 29
Risk Level: low
Testing: ci
Docs Changes: n/a
Release Notes: n/a
[Optional Fixes #Issue]
[Optional Deprecated:]

Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build no stalebot Disables stalebot from closing an issue
Projects
None yet
Development

No branches or pull requests

5 participants