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

Add support for sanitizer recover and tracking origins of uninitialized memory #66522

Merged
merged 5 commits into from
Nov 26, 2019

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Nov 18, 2019

  • Add support for sanitizer recovery -Zsanitizer-recover=... (equivalent to -fsanitize-recover in clang).
  • Add support for tracking origins of uninitialized memory in MemorySanitizer -Zsanitizer-memory-track-origins (equivalent to -fsanitize-memory-track-origins in clang).

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cramertj (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 18, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-18T16:57:16.4584905Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-18T16:57:16.4787044Z ##[command]git config gc.auto 0
2019-11-18T16:57:16.4866999Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-18T16:57:16.4927323Z ##[command]git config --get-all http.proxy
2019-11-18T16:57:16.5075827Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66522/merge:refs/remotes/pull/66522/merge
---
2019-11-18T17:25:17.2381771Z    Compiling rustc_llvm v0.0.0 (/checkout/src/librustc_llvm)
2019-11-18T17:25:19.2776194Z error: failed to run custom build command for `rustc_llvm v0.0.0 (/checkout/src/librustc_llvm)`
2019-11-18T17:25:19.2777071Z 
2019-11-18T17:25:19.2777185Z Caused by:
2019-11-18T17:25:19.2785502Z   process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-codegen/release/build/rustc_llvm-e3ad2447f0c5c3b9/build-script-build` (exit code: 1)
2019-11-18T17:25:19.2785736Z --- stdout
2019-11-18T17:25:19.2785993Z cargo:rerun-if-env-changed=REAL_LIBRARY_PATH_VAR
2019-11-18T17:25:19.2786213Z cargo:rerun-if-env-changed=REAL_LIBRARY_PATH
2019-11-18T17:25:19.2786904Z cargo:rerun-if-changed=/usr/lib/llvm-6.0/bin/llvm-config
2019-11-18T17:25:19.2787183Z cargo:rerun-if-env-changed=LLVM_CONFIG
2019-11-18T17:25:19.2787419Z cargo:rustc-cfg=llvm_component="aarch64"
2019-11-18T17:25:19.2787640Z cargo:rustc-cfg=llvm_component="amdgpu"
2019-11-18T17:25:19.2787885Z cargo:rustc-cfg=llvm_component="arm"
2019-11-18T17:25:19.2788288Z cargo:rustc-cfg=llvm_component="asmparser"
2019-11-18T17:25:19.2788576Z cargo:rustc-cfg=llvm_component="bitreader"
2019-11-18T17:25:19.2788829Z cargo:rustc-cfg=llvm_component="bitwriter"
2019-11-18T17:25:19.2789069Z cargo:rustc-cfg=llvm_component="hexagon"
2019-11-18T17:25:19.2789302Z cargo:rustc-cfg=llvm_component="instrumentation"
2019-11-18T17:25:19.2789543Z cargo:rustc-cfg=llvm_component="ipo"
2019-11-18T17:25:19.2789767Z cargo:rustc-cfg=llvm_component="linker"
2019-11-18T17:25:19.2790195Z cargo:rustc-cfg=llvm_component="lto"
2019-11-18T17:25:19.2790423Z cargo:rustc-cfg=llvm_component="mips"
2019-11-18T17:25:19.2790634Z cargo:rustc-cfg=llvm_component="msp430"
2019-11-18T17:25:19.2790836Z cargo:rustc-cfg=llvm_component="nvptx"
2019-11-18T17:25:19.2791041Z cargo:rustc-cfg=llvm_component="powerpc"
2019-11-18T17:25:19.2791269Z cargo:rustc-cfg=llvm_component="sparc"
2019-11-18T17:25:19.2791478Z cargo:rustc-cfg=llvm_component="systemz"
2019-11-18T17:25:19.2791693Z cargo:rustc-cfg=llvm_component="x86"
2019-11-18T17:25:19.2791923Z cargo:rerun-if-changed-env=LLVM_RUSTLLVM
2019-11-18T17:25:19.2792144Z cargo:rerun-if-changed=../rustllvm/ArchiveWrapper.cpp
2019-11-18T17:25:19.2792367Z cargo:rerun-if-changed=../rustllvm/Linker.cpp
2019-11-18T17:25:19.2792602Z cargo:rerun-if-changed=../rustllvm/.editorconfig
2019-11-18T17:25:19.2792824Z cargo:rerun-if-changed=../rustllvm/PassWrapper.cpp
2019-11-18T17:25:19.2793044Z cargo:rerun-if-changed=../rustllvm/RustWrapper.cpp
2019-11-18T17:25:19.2793446Z cargo:rerun-if-changed=../rustllvm/README
2019-11-18T17:25:19.2793852Z cargo:rerun-if-changed=../rustllvm/rustllvm.h
2019-11-18T17:25:19.2794079Z TARGET = Some("x86_64-unknown-linux-gnu")
2019-11-18T17:25:19.2794148Z OPT_LEVEL = Some("2")
2019-11-18T17:25:19.2794377Z HOST = Some("x86_64-unknown-linux-gnu")
2019-11-18T17:25:19.2794615Z CXX_x86_64-unknown-linux-gnu = Some("sccache c++")
2019-11-18T17:25:19.2794894Z CXXFLAGS_x86_64-unknown-linux-gnu = Some("-ffunction-sections -fdata-sections -fPIC -m64")
2019-11-18T17:25:19.2794978Z CRATE_CC_NO_DEFAULTS = None
2019-11-18T17:25:19.2795028Z DEBUG = Some("false")
2019-11-18T17:25:19.2795075Z CARGO_CFG_TARGET_FEATURE = Some("fxsr,mmx,sse,sse2")
2019-11-18T17:25:19.2797782Z running: "sccache" "c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I/usr/lib/llvm-6.0/include" "-std=c++0x" "-fuse-ld=gold" "-Wl,--no-keep-files-mapped" "-Wl,--no-map-whole-files" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-std=c++11" "-Wall" "-W" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wno-missing-field-initializers" "-pedantic" "-Wno-long-long" "-Wno-maybe-uninitialized" "-Wdelete-non-virtual-dtor" "-Wno-comment" "-ffunction-sections" "-fdata-sections" "-O2" "-DNDEBUG" "-fno-exceptions" "-D_GNU_SOURCE" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AARCH64" "-DLLVM_COMPONENT_AMDGPU" "-DLLVM_COMPONENT_ARM" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_HEXAGON" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_SPARC" "-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_X86" "-DNDEBUG" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-codegen/x86_64-unknown-linux-gnu/release/build/rustc_llvm-b63a5c43d180ed4c/out/../rustllvm/PassWrapper.o" "-c" "../rustllvm/PassWrapper.cpp"
2019-11-18T17:25:19.2798170Z cargo:warning=../rustllvm/PassWrapper.cpp:21:62: fatal error: llvm/Transforms/Instrumentation/AddressSanitizer.h: No such file or directory
2019-11-18T17:25:19.2798247Z cargo:warning=compilation terminated.
2019-11-18T17:25:19.2798330Z 
2019-11-18T17:25:19.2798630Z --- stderr
2019-11-18T17:25:19.2798663Z 
2019-11-18T17:25:19.2798689Z 
2019-11-18T17:25:19.2798689Z 
2019-11-18T17:25:19.2800912Z error occurred: Command "sccache" "c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I/usr/lib/llvm-6.0/include" "-std=c++0x" "-fuse-ld=gold" "-Wl,--no-keep-files-mapped" "-Wl,--no-map-whole-files" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-std=c++11" "-Wall" "-W" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wno-missing-field-initializers" "-pedantic" "-Wno-long-long" "-Wno-maybe-uninitialized" "-Wdelete-non-virtual-dtor" "-Wno-comment" "-ffunction-sections" "-fdata-sections" "-O2" "-DNDEBUG" "-fno-exceptions" "-D_GNU_SOURCE" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AARCH64" "-DLLVM_COMPONENT_AMDGPU" "-DLLVM_COMPONENT_ARM" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_HEXAGON" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_SPARC" "-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_X86" "-DNDEBUG" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-codegen/x86_64-unknown-linux-gnu/release/build/rustc_llvm-b63a5c43d180ed4c/out/../rustllvm/PassWrapper.o" "-c" "../rustllvm/PassWrapper.cpp" with args "c++" did not execute successfully (status code exit code: 1).
2019-11-18T17:25:19.2801194Z 
2019-11-18T17:25:19.2801218Z 
2019-11-18T17:25:19.2803072Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "-Zconfig-profile" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--locked" "--color" "always" "--manifest-path" "/checkout/src/librustc_codegen_llvm/Cargo.toml" "--features" "" "--message-format" "json-render-diagnostics"
2019-11-18T17:25:19.2803158Z expected success, got: exit code: 101
2019-11-18T17:25:19.2803158Z expected success, got: exit code: 101
2019-11-18T17:25:19.2809692Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-11-18T17:25:19.2809770Z Build completed unsuccessfully in 0:21:42
2019-11-18T17:25:19.2871919Z == clock drift check ==
2019-11-18T17:25:19.2887418Z   local time: Mon Nov 18 17:25:19 UTC 2019
2019-11-18T17:25:19.5679697Z   network time: Mon, 18 Nov 2019 17:25:19 GMT
2019-11-18T17:25:19.5683488Z == end clock drift check ==
2019-11-18T17:25:22.0469510Z 
2019-11-18T17:25:22.0540261Z ##[error]Bash exited with code '1'.
2019-11-18T17:25:22.0574454Z ##[section]Starting: Checkout
2019-11-18T17:25:22.0577203Z ==============================================================================
2019-11-18T17:25:22.0577264Z Task         : Get sources
2019-11-18T17:25:22.0577333Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@cramertj
Copy link
Member

@bors r? @alexcrichton

@@ -363,6 +363,27 @@ pub(crate) unsafe fn optimize(cgcx: &CodegenContext<LlvmCodegenBackend>,
}
}

if let Some(sanitizer) = &config.sanitizer {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to it's own function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to a separate function.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Nov 19, 2019

📌 Commit 5024d14 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2019
@rust-highfive
Copy link
Collaborator

Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-19T18:39:40.7392580Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-19T18:39:40.7600140Z ##[command]git config gc.auto 0
2019-11-19T18:39:40.7689238Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-19T18:39:40.7743188Z ##[command]git config --get-all http.proxy
2019-11-19T18:39:40.7908660Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/66522/merge:refs/remotes/pull/66522/merge
---
2019-11-19T18:42:23.6554635Z Attempting with retry: docker build --rm -t rust-ci -f /home/vsts/work/1/s/src/ci/docker/x86_64-gnu-llvm-6.0/Dockerfile /home/vsts/work/1/s/src/ci/docker
2019-11-19T18:42:23.8303994Z Sending build context to Docker daemon  528.4kB
2019-11-19T18:42:23.8304247Z 
2019-11-19T18:42:23.8708609Z Step 1/8 : FROM ubuntu:16.04
2019-11-19T18:42:24.5221227Z Get https://registry-1.docker.io/v2/library/ubuntu/manifests/16.04: received unexpected HTTP status: 500 Internal Server Error
2019-11-19T18:42:25.6338616Z Sending build context to Docker daemon  528.4kB
2019-11-19T18:42:25.6338856Z 
2019-11-19T18:42:25.6498291Z Step 1/8 : FROM ubuntu:16.04
2019-11-19T18:42:25.6498291Z Step 1/8 : FROM ubuntu:16.04
2019-11-19T18:42:26.7173336Z Get https://registry-1.docker.io/v2/library/ubuntu/manifests/16.04: received unexpected HTTP status: 500 Internal Server Error
2019-11-19T18:42:28.3400393Z Sending build context to Docker daemon  528.4kB
2019-11-19T18:42:28.3400769Z 
2019-11-19T18:42:28.3618580Z Step 1/8 : FROM ubuntu:16.04
2019-11-19T18:42:28.3618580Z Step 1/8 : FROM ubuntu:16.04
2019-11-19T18:42:28.8721990Z Get https://registry-1.docker.io/v2/library/ubuntu/manifests/16.04: received unexpected HTTP status: 500 Internal Server Error
2019-11-19T18:42:32.0770280Z Sending build context to Docker daemon  528.4kB
2019-11-19T18:42:32.0771015Z 
2019-11-19T18:42:32.0979617Z Step 1/8 : FROM ubuntu:16.04
2019-11-19T18:42:32.0979617Z Step 1/8 : FROM ubuntu:16.04
2019-11-19T18:42:32.6030157Z Get https://registry-1.docker.io/v2/library/ubuntu/manifests/16.04: received unexpected HTTP status: 500 Internal Server Error
2019-11-19T18:42:36.7416024Z Sending build context to Docker daemon  528.4kB
2019-11-19T18:42:36.7416687Z 
2019-11-19T18:42:36.7617495Z Step 1/8 : FROM ubuntu:16.04
2019-11-19T18:42:36.7617495Z Step 1/8 : FROM ubuntu:16.04
2019-11-19T18:42:37.2824441Z Get https://registry-1.docker.io/v2/library/ubuntu/manifests/16.04: received unexpected HTTP status: 500 Internal Server Error
2019-11-19T18:42:37.2887737Z 
2019-11-19T18:42:37.2887737Z 
2019-11-19T18:42:37.2998110Z ##[error]Bash exited with code '1'.
2019-11-19T18:42:37.3029312Z ##[section]Starting: Checkout
2019-11-19T18:42:37.3031887Z ==============================================================================
2019-11-19T18:42:37.3031942Z Task         : Get sources
2019-11-19T18:42:37.3032009Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@tmiasko
Copy link
Contributor Author

tmiasko commented Nov 20, 2019

Get https://registry-1.docker.io/v2/library/ubuntu/manifests/16.04: received unexpected HTTP status: 500 Internal Server Error

Spurious CI failure.

@alexcrichton
Copy link
Member

@bors: retry

@tmiasko tmiasko closed this Nov 22, 2019
@tmiasko tmiasko reopened this Nov 22, 2019
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Nov 22, 2019

📌 Commit 3b45626 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Nov 22, 2019

⌛ Testing commit 3b45626 with merge 2e1551d...

bors added a commit that referenced this pull request Nov 22, 2019
Add support for sanitizer recover and tracking origins of uninitialized memory

* Add support for sanitizer recovery `-Zsanitizer-recover=...` (equivalent to `-fsanitize-recover` in clang).
* Add support for tracking origins of uninitialized memory in MemorySanitizer `-Zsanitizer-memory-track-origins` (equivalent to `-fsanitize-memory-track-origins` in clang).
@bors
Copy link
Contributor

bors commented Nov 22, 2019

💔 Test failed - checks-azure

@rust-highfive
Copy link
Collaborator

The job x86_64-apple of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-22T18:13:30.9806490Z test [codegen] codegen/remap_path_prefix/xcrate-generic.rs ... ok
2019-11-22T18:13:31.0209740Z test [codegen] codegen/repeat-trusted-len.rs ... ok
2019-11-22T18:13:31.0892010Z test [codegen] codegen/repr-transparent-sysv64.rs ... ok
2019-11-22T18:13:31.1194440Z test [codegen] codegen/repr-transparent-aggregates-1.rs ... ok
2019-11-22T18:13:31.1217100Z test [codegen] codegen/sanitizer-memory-track-orgins.rs#MSAN-0 ... FAILED
2019-11-22T18:13:31.1798800Z test [codegen] codegen/repr-transparent.rs ... ok
2019-11-22T18:13:31.2000250Z test [codegen] codegen/sanitizer-memory-track-orgins.rs#MSAN-1 ... FAILED
2019-11-22T18:13:31.2302080Z test [codegen] codegen/sanitizer-memory-track-orgins.rs#MSAN-2 ... FAILED
2019-11-22T18:13:31.2904570Z test [codegen] codegen/sanitizer-recover.rs#ASAN ... ok
2019-11-22T18:13:31.3106080Z test [codegen] codegen/sanitizer-recover.rs#MSAN ... FAILED
2019-11-22T18:13:31.3407880Z test [codegen] codegen/sanitizer-recover.rs#MSAN-RECOVER ... FAILED
2019-11-22T18:13:31.3409640Z test [codegen] codegen/sanitizer-recover.rs#ASAN-RECOVER ... ok
2019-11-22T18:13:31.5810280Z test [codegen] codegen/simd-intrinsic/simd-intrinsic-float-abs.rs ... ok
2019-11-22T18:13:31.6143950Z test [codegen] codegen/simd-intrinsic/simd-intrinsic-float-ceil.rs ... ok
2019-11-22T18:13:31.6244670Z test [codegen] codegen/simd-intrinsic/simd-intrinsic-float-cos.rs ... ok
2019-11-22T18:13:31.7167540Z test [codegen] codegen/simd-intrinsic/simd-intrinsic-float-exp.rs ... ok
---
2019-11-22T18:13:33.8658700Z test [codegen] codegen/zip.rs ... ok
2019-11-22T18:13:33.8658920Z 
2019-11-22T18:13:33.8659050Z failures:
2019-11-22T18:13:33.8659100Z 
2019-11-22T18:13:33.8661940Z ---- [codegen] codegen/sanitizer-memory-track-orgins.rs#MSAN-0 stdout ----
2019-11-22T18:13:33.8662130Z 
2019-11-22T18:13:33.8662850Z error in revision `MSAN-0`: compilation failed!
2019-11-22T18:13:33.8663000Z status: exit code: 1
2019-11-22T18:13:33.8664610Z command: "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/stage2/bin/rustc" "/Users/runner/runners/2.160.1/work/1/s/src/test/codegen/sanitizer-memory-track-orgins.rs" "-Zthreads=1" "--target=x86_64-apple-darwin" "--cfg" "msan_0" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/test/codegen/sanitizer-memory-track-orgins.MSAN-0" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/native/rust-test-helpers" "-Zsanitizer=memory" "-L" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/test/codegen/sanitizer-memory-track-orgins.MSAN-0/auxiliary" "--emit=llvm-ir"
2019-11-22T18:13:33.8665670Z ------------------------------------------
2019-11-22T18:13:33.8665770Z 
2019-11-22T18:13:33.8666810Z ------------------------------------------
2019-11-22T18:13:33.8666940Z stderr:
2019-11-22T18:13:33.8666940Z stderr:
2019-11-22T18:13:33.8667580Z ------------------------------------------
2019-11-22T18:13:33.8668310Z error: MemorySanitizer only works with the `x86_64-unknown-linux-gnu` target
2019-11-22T18:13:33.8668510Z error: aborting due to previous error
2019-11-22T18:13:33.8668570Z 
2019-11-22T18:13:33.8668610Z 
2019-11-22T18:13:33.8669270Z ------------------------------------------
2019-11-22T18:13:33.8669270Z ------------------------------------------
2019-11-22T18:13:33.8669350Z 
2019-11-22T18:13:33.8669410Z 
2019-11-22T18:13:33.8670100Z ---- [codegen] codegen/sanitizer-memory-track-orgins.rs#MSAN-1 stdout ----
2019-11-22T18:13:33.8670190Z 
2019-11-22T18:13:33.8670860Z error in revision `MSAN-1`: compilation failed!
2019-11-22T18:13:33.8670990Z status: exit code: 1
2019-11-22T18:13:33.8672630Z command: "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/stage2/bin/rustc" "/Users/runner/runners/2.160.1/work/1/s/src/test/codegen/sanitizer-memory-track-orgins.rs" "-Zthreads=1" "--target=x86_64-apple-darwin" "--cfg" "msan_1" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/test/codegen/sanitizer-memory-track-orgins.MSAN-1" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/native/rust-test-helpers" "-Zsanitizer=memory" "-Zsanitizer-memory-track-origins=1" "-L" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/test/codegen/sanitizer-memory-track-orgins.MSAN-1/auxiliary" "--emit=llvm-ir"
2019-11-22T18:13:33.8673740Z ------------------------------------------
2019-11-22T18:13:33.8673820Z 
2019-11-22T18:13:33.8674480Z ------------------------------------------
2019-11-22T18:13:33.8674810Z stderr:
2019-11-22T18:13:33.8674810Z stderr:
2019-11-22T18:13:33.8675580Z ------------------------------------------
2019-11-22T18:13:33.8676290Z error: MemorySanitizer only works with the `x86_64-unknown-linux-gnu` target
2019-11-22T18:13:33.8676500Z error: aborting due to previous error
2019-11-22T18:13:33.8676570Z 
2019-11-22T18:13:33.8676610Z 
2019-11-22T18:13:33.8677280Z ------------------------------------------
2019-11-22T18:13:33.8677280Z ------------------------------------------
2019-11-22T18:13:33.8677360Z 
2019-11-22T18:13:33.8677400Z 
2019-11-22T18:13:33.8678250Z ---- [codegen] codegen/sanitizer-memory-track-orgins.rs#MSAN-2 stdout ----
2019-11-22T18:13:33.8678340Z 
2019-11-22T18:13:33.8679020Z error in revision `MSAN-2`: compilation failed!
2019-11-22T18:13:33.8679130Z status: exit code: 1
2019-11-22T18:13:33.8680760Z command: "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/stage2/bin/rustc" "/Users/runner/runners/2.160.1/work/1/s/src/test/codegen/sanitizer-memory-track-orgins.rs" "-Zthreads=1" "--target=x86_64-apple-darwin" "--cfg" "msan_2" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/test/codegen/sanitizer-memory-track-orgins.MSAN-2" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/native/rust-test-helpers" "-Zsanitizer=memory" "-Zsanitizer-memory-track-origins" "-L" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/test/codegen/sanitizer-memory-track-orgins.MSAN-2/auxiliary" "--emit=llvm-ir"
2019-11-22T18:13:33.8681820Z ------------------------------------------
2019-11-22T18:13:33.8681920Z 
2019-11-22T18:13:33.8682570Z ------------------------------------------
2019-11-22T18:13:33.8682690Z stderr:
2019-11-22T18:13:33.8682690Z stderr:
2019-11-22T18:13:33.8683330Z ------------------------------------------
2019-11-22T18:13:33.8684060Z error: MemorySanitizer only works with the `x86_64-unknown-linux-gnu` target
2019-11-22T18:13:33.8684270Z error: aborting due to previous error
2019-11-22T18:13:33.8684320Z 
2019-11-22T18:13:33.8684380Z 
2019-11-22T18:13:33.8685020Z ------------------------------------------
2019-11-22T18:13:33.8685020Z ------------------------------------------
2019-11-22T18:13:33.8685100Z 
2019-11-22T18:13:33.8685160Z 
2019-11-22T18:13:33.8686130Z ---- [codegen] codegen/sanitizer-recover.rs#MSAN stdout ----
2019-11-22T18:13:33.8686230Z 
2019-11-22T18:13:33.8686310Z error in revision `MSAN`: compilation failed!
2019-11-22T18:13:33.8686410Z status: exit code: 1
2019-11-22T18:13:33.8688030Z command: "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/stage2/bin/rustc" "/Users/runner/runners/2.160.1/work/1/s/src/test/codegen/sanitizer-recover.rs" "-Zthreads=1" "--target=x86_64-apple-darwin" "--cfg" "msan" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/test/codegen/sanitizer-recover.MSAN" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/native/rust-test-helpers" "-Zsanitizer=memory" "-L" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/test/codegen/sanitizer-recover.MSAN/auxiliary" "--emit=llvm-ir"
2019-11-22T18:13:33.8689140Z ------------------------------------------
2019-11-22T18:13:33.8689250Z 
2019-11-22T18:13:33.8689900Z ------------------------------------------
2019-11-22T18:13:33.8690020Z stderr:
2019-11-22T18:13:33.8690020Z stderr:
2019-11-22T18:13:33.8690660Z ------------------------------------------
2019-11-22T18:13:33.8691390Z error: MemorySanitizer only works with the `x86_64-unknown-linux-gnu` target
2019-11-22T18:13:33.8691570Z error: aborting due to previous error
2019-11-22T18:13:33.8691620Z 
2019-11-22T18:13:33.8691670Z 
2019-11-22T18:13:33.8692320Z ------------------------------------------
2019-11-22T18:13:33.8692320Z ------------------------------------------
2019-11-22T18:13:33.8692400Z 
2019-11-22T18:13:33.8692440Z 
2019-11-22T18:13:33.8693140Z ---- [codegen] codegen/sanitizer-recover.rs#MSAN-RECOVER stdout ----
2019-11-22T18:13:33.8693220Z 
2019-11-22T18:13:33.8694090Z error in revision `MSAN-RECOVER`: compilation failed!
2019-11-22T18:13:33.8694250Z status: exit code: 1
2019-11-22T18:13:33.8696100Z command: "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/stage2/bin/rustc" "/Users/runner/runners/2.160.1/work/1/s/src/test/codegen/sanitizer-recover.rs" "-Zthreads=1" "--target=x86_64-apple-darwin" "--cfg" "msan_recover" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/test/codegen/sanitizer-recover.MSAN-RECOVER" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/native/rust-test-helpers" "-Zsanitizer=memory" "-Zsanitizer-recover=memory" "-L" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/test/codegen/sanitizer-recover.MSAN-RECOVER/auxiliary" "--emit=llvm-ir"
2019-11-22T18:13:33.8697240Z ------------------------------------------
2019-11-22T18:13:33.8697320Z 
2019-11-22T18:13:33.8697990Z ------------------------------------------
2019-11-22T18:13:33.8698100Z stderr:
2019-11-22T18:13:33.8698100Z stderr:
2019-11-22T18:13:33.8698760Z ------------------------------------------
2019-11-22T18:13:33.8699470Z error: MemorySanitizer only works with the `x86_64-unknown-linux-gnu` target
2019-11-22T18:13:33.8699680Z error: aborting due to previous error
2019-11-22T18:13:33.8699750Z 
2019-11-22T18:13:33.8699790Z 
2019-11-22T18:13:33.8700440Z ------------------------------------------
2019-11-22T18:13:33.8700440Z ------------------------------------------
2019-11-22T18:13:33.8700540Z 
2019-11-22T18:13:33.8700580Z 
2019-11-22T18:13:33.8700630Z 
2019-11-22T18:13:33.8700710Z failures:
2019-11-22T18:13:33.8701390Z     [codegen] codegen/sanitizer-memory-track-orgins.rs#MSAN-0
2019-11-22T18:13:33.8702110Z     [codegen] codegen/sanitizer-memory-track-orgins.rs#MSAN-1
2019-11-22T18:13:33.8702830Z     [codegen] codegen/sanitizer-memory-track-orgins.rs#MSAN-2
2019-11-22T18:13:33.8703520Z     [codegen] codegen/sanitizer-recover.rs#MSAN
2019-11-22T18:13:33.8704230Z     [codegen] codegen/sanitizer-recover.rs#MSAN-RECOVER
2019-11-22T18:13:33.8705050Z test result: FAILED. 145 passed; 5 failed; 14 ignored; 0 measured; 0 filtered out
2019-11-22T18:13:33.8705140Z 
2019-11-22T18:13:33.8705850Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-11-22T18:13:33.8706270Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-11-22T18:13:33.8706270Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-11-22T18:13:33.8706340Z 
2019-11-22T18:13:33.8706410Z 
2019-11-22T18:13:33.8709740Z command did not execute successfully: "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/stage0-tools-bin/compiletest" "--compile-lib-path" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/stage2/lib" "--run-lib-path" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/lib" "--rustc-path" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/stage2/bin/rustc" "--src-base" "/Users/runner/runners/2.160.1/work/1/s/src/test/codegen" "--build-base" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/test/codegen" "--stage-id" "stage2-x86_64-apple-darwin" "--mode" "codegen" "--target" "x86_64-apple-darwin" "--host" "x86_64-apple-darwin" "--llvm-filecheck" "/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/llvm/build/bin/FileCheck" "--nodejs" "/usr/local/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/Users/runner/runners/2.160.1/work/1/s/build/x86_64-apple-darwin/native/rust-test-helpers" "--docck-python" "/usr/local/bin/python2.7" "--lldb-python" "/usr/bin/python" "--lldb-version" "lldb-902.0.79.2\n  Swift-4.1\n" "--lldb-python-dir" "/Applications/Xcode_9.3.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python" "--llvm-version" "9.0.0-rust-1.41.0-dev\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-11-22T18:13:33.8710790Z 
2019-11-22T18:13:33.8710840Z 
2019-11-22T18:13:33.8710940Z failed to run: /Users/runner/runners/2.160.1/work/1/s/build/bootstrap/debug/bootstrap test
2019-11-22T18:13:33.8711050Z Build completed unsuccessfully in 0:59:28
2019-11-22T18:13:33.8711050Z Build completed unsuccessfully in 0:59:28
2019-11-22T18:13:33.8711180Z == clock drift check ==
2019-11-22T18:13:33.8770660Z   local time: Fri Nov 22 18:13:33 UTC 2019
2019-11-22T18:13:33.9668440Z   network time: Fri, 22 Nov 2019 18:13:33 GMT
2019-11-22T18:13:33.9670890Z == end clock drift check ==
2019-11-22T18:13:33.9720250Z 
2019-11-22T18:13:33.9863630Z ##[error]Bash exited with code '1'.
2019-11-22T18:13:33.9915990Z ##[section]Starting: Checkout
2019-11-22T18:13:33.9919010Z ==============================================================================
2019-11-22T18:13:33.9919140Z Task         : Get sources
2019-11-22T18:13:33.9919250Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 22, 2019
@tmiasko
Copy link
Contributor Author

tmiasko commented Nov 22, 2019

Rebased and amended the tests to run them only on linux x86_64, since memory sanitizer is not currently supported anywhere else.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Nov 25, 2019

📌 Commit bf121a3 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 25, 2019
@bors
Copy link
Contributor

bors commented Nov 26, 2019

⌛ Testing commit bf121a3 with merge 2626f3d...

bors added a commit that referenced this pull request Nov 26, 2019
Add support for sanitizer recover and tracking origins of uninitialized memory

* Add support for sanitizer recovery `-Zsanitizer-recover=...` (equivalent to `-fsanitize-recover` in clang).
* Add support for tracking origins of uninitialized memory in MemorySanitizer `-Zsanitizer-memory-track-origins` (equivalent to `-fsanitize-memory-track-origins` in clang).
@bors
Copy link
Contributor

bors commented Nov 26, 2019

☀️ Test successful - checks-azure
Approved by: alexcrichton
Pushing 2626f3d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 26, 2019
@bors bors merged commit bf121a3 into rust-lang:master Nov 26, 2019
cuviper added a commit to cuviper/rust that referenced this pull request Dec 2, 2019
LLVM 7 is over a year old, which should be plenty for compatibility. The
last LLVM 6 holdout was llvm-emscripten, which went away in rust-lang#65501.

I've also included a fix for LLVM 8 lacking `MemorySanitizerOptions`,
which was broken by rust-lang#66522.
Centril added a commit to Centril/rust that referenced this pull request Dec 3, 2019
Update the minimum external LLVM to 7

LLVM 7 is over a year old, which should be plenty for compatibility. The
last LLVM 6 holdout was llvm-emscripten, which went away in rust-lang#65501.

I've also included a fix for LLVM 8 lacking `MemorySanitizerOptions`,
which was broken by rust-lang#66522.
Centril added a commit to Centril/rust that referenced this pull request Dec 3, 2019
Update the minimum external LLVM to 7

LLVM 7 is over a year old, which should be plenty for compatibility. The
last LLVM 6 holdout was llvm-emscripten, which went away in rust-lang#65501.

I've also included a fix for LLVM 8 lacking `MemorySanitizerOptions`,
which was broken by rust-lang#66522.
@tmiasko tmiasko deleted the sanitize-flags branch March 1, 2020 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants