Skip to content
New issue

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

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

Already on GitHub? # to your account

-Zsanitizer=address no longer works on macOS as of past 9 days #66140

Closed
nagisa opened this issue Nov 6, 2019 · 8 comments
Closed

-Zsanitizer=address no longer works on macOS as of past 9 days #66140

nagisa opened this issue Nov 6, 2019 · 8 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries A-sanitizers Area: Sanitizers for correctness and code quality O-macos Operating system: macOS P-medium Medium priority requires-nightly This issue requires a nightly compiler in some way.

Comments

@nagisa
Copy link
Member

nagisa commented Nov 6, 2019

We now fail to find lib__rustc__clang_rt.asan_osx_dynamic.dylib which is still shipped with rustc, as of today:

-rw-r--r-- 501/20      2090160 2019-10-05 00:09 rustc-nightly-x86_64-apple-darwin/rustc/lib/lib__rustc__clang_rt.asan_osx_dynamic.dylib

with an error like this

error: linking with `cc` failed: exit code: 1

  |

  = note: "cc" "-m64" "-L" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/travis/build/rust-fuzz/cargo-fuzz/testcrate/fuzz/target/x86_64-apple-darwin/debug/deps/fuzz_target_1-b5a0a2a6c0bc4c75.48gbajpcuvjdt2ep.rcgu.o" "-o" "/Users/travis/build/rust-fuzz/cargo-fuzz/testcrate/fuzz/target/x86_64-apple-darwin/debug/deps/fuzz_target_1-b5a0a2a6c0bc4c75" "/Users/travis/build/rust-fuzz/cargo-fuzz/testcrate/fuzz/target/x86_64-apple-darwin/debug/deps/fuzz_target_1-b5a0a2a6c0bc4c75.11fu4mmmo8ucm7cx.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/travis/build/rust-fuzz/cargo-fuzz/testcrate/fuzz/target/x86_64-apple-darwin/debug/deps" "-L" "/Users/travis/build/rust-fuzz/cargo-fuzz/testcrate/fuzz/target/debug/deps" "-L" "/Users/travis/build/rust-fuzz/cargo-fuzz/testcrate/fuzz/target/x86_64-apple-darwin/debug/build/libfuzzer-sys-c1f241ca367e8ae2/out" "-L" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-Wl,-rpath" "-Xlinker" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-Wl,-force_load" "-Wl,/var/folders/bb/n7t3rs157850byt_jfdcq9k80000gn/T/rustc8ZCLuV/librustc_asan-982e6a5feba15799.rlib" "/Users/travis/build/rust-fuzz/cargo-fuzz/testcrate/fuzz/target/x86_64-apple-darwin/debug/deps/libtestcrate-d44e7d6b51f838b8.rlib" "/Users/travis/build/rust-fuzz/cargo-fuzz/testcrate/fuzz/target/x86_64-apple-darwin/debug/deps/liblibfuzzer_sys-2a8c342d22eff36e.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-cd43daae2cf7ddf1.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-8db2c641f3653a71.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-028605a5a8e4ba77.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-d8c165584b999613.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libbacktrace-8ca59077c26b8378.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libbacktrace_sys-9e5cb6a845ac1bcb.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-428f6f0ce2c8cd70.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-5b4e5f1e334da9a7.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-0c3a77eecc027943.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-5ff1b410a39476d9.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-bc9ef7c32fbaa74f.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-3ee6ce2ac9d08f55.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-9b01ec0dd7c68c5f.rlib" "/Users/travis/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-dae0483206048e13.rlib" "-l__rustc__clang_rt.asan_osx_dynamic" "-lc++" "-lSystem" "-lresolv" "-lc" "-lm"
  = note: ld: library not found for -l__rustc__clang_rt.asan_osx_dynamic
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

The issue is probably the -L flag that’s no longer included because we do not anticipate people linking to the internal rustc libraries.

@nagisa nagisa added A-linkage Area: linking into static, shared libraries and binaries O-macos Operating system: macOS regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. A-sanitizers Area: Sanitizers for correctness and code quality labels Nov 6, 2019
@nagisa
Copy link
Member Author

nagisa commented Nov 6, 2019

FWIW I do no longer have a macos VM on hand to investigate this, an upgrade to OVMF broke something and I’m not too interested in investigating it at this point in time.

@nagisa
Copy link
Member Author

nagisa commented Nov 6, 2019

Regression range:

last known good: rustc 1.40.0-nightly (4a8c5b2 2019-10-23)
first known bad: rustc 1.40.0-nightly (95f437b 2019-10-27)

@Centril Centril added the requires-nightly This issue requires a nightly compiler in some way. label Nov 6, 2019
@tmiasko
Copy link
Contributor

tmiasko commented Nov 6, 2019

The rust-std component no longer contains sanitizer runtime on macOS
in lib/rustlib/x86_64-apple-darwin/lib/, so it might be related to
changes that "minimize the rust-std component".

@nagisa
Copy link
Member Author

nagisa commented Nov 6, 2019

You’re right, it does indeed look like we used to stick that library into the rust-std component previously and fail to do so anymore.

@ollie27
Copy link
Member

ollie27 commented Nov 6, 2019

This looks like it will be fixed as part of #65241.

@Centril Centril removed the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Nov 7, 2019
@pnkfelix
Copy link
Member

pnkfelix commented Nov 7, 2019

triage: P-medium.

@sfackler
Copy link
Member

This is now fixed.

@kianenigma
Copy link

Getting exact same linker error when compiling cargo-fuzz on latest macos.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries A-sanitizers Area: Sanitizers for correctness and code quality O-macos Operating system: macOS P-medium Medium priority requires-nightly This issue requires a nightly compiler in some way.
Projects
None yet
Development

No branches or pull requests

7 participants