Skip to content

Leak sanitizer does not work on aarch64 macOS #98473

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

Closed
BlackHoleFox opened this issue Jun 25, 2022 · 4 comments
Closed

Leak sanitizer does not work on aarch64 macOS #98473

BlackHoleFox opened this issue Jun 25, 2022 · 4 comments
Labels
A-sanitizers Area: Sanitizers for correctness and code quality C-bug Category: This is a bug. O-macos Operating system: macOS

Comments

@BlackHoleFox
Copy link
Contributor

I tried this code:

fn main() {
   println!("leak time");
   
   <snip some Objective-C code that has leaks>
}
[package]
name = "example"
version = "0.1.0"
edition = "2021"

[dependencies]
mac-notification-sys = "0.5.2"
export RUSTFLAGS="-Z sanitizer=leak";
cargo +nightly run

I expected to see this happen: The binary would be built and run with the leak sanitizer enabled.

Instead, this happened:
rustc writes an unsupported error and exits. The sanitizer docs state aarch64-apple-darwin to be a supported target, which conflicts with the actual behavior. I don't know if the documentation is incorrect or if there's a compiler bug somewhere.

Meta

rustc --version --verbose:

rustc 1.63.0-nightly (43347397f 2022-06-23)
binary: rustc
commit-hash: 43347397f7c5ca9a670a3bb3890c7187e24a52ab
commit-date: 2022-06-23
host: aarch64-apple-darwin
release: 1.63.0-nightly
LLVM version: 14.0.5
Backtrace

error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -Z sanitizer=leak --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit status: 1)
  --- stdout
  ___
  lib___.rlib
  lib___.dylib
  lib___.dylib
  lib___.a
  lib___.dylib
  /Users/fox/.rustup/toolchains/nightly-aarch64-apple-darwin
  debug_assertions
  panic="unwind"
  proc_macro
  sanitize="leak"
  target_abi=""
  target_arch="aarch64"
  target_endian="little"
  target_env=""
  target_family="unix"
  target_feature="aes"
  target_feature="crc"
  target_feature="dit"
  target_feature="dotprod"
  target_feature="dpb"
  target_feature="dpb2"
  target_feature="fcma"
  target_feature="fhm"
  target_feature="flagm"
  target_feature="fp16"
  target_feature="frintts"
  target_feature="jsconv"
  target_feature="llvm14-builtins-abi"
  target_feature="lor"
  target_feature="lse"
  target_feature="neon"
  target_feature="paca"
  target_feature="pacg"
  target_feature="pan"
  target_feature="pmuv3"
  target_feature="ras"
  target_feature="rcpc"
  target_feature="rcpc2"
  target_feature="rdm"
  target_feature="sb"
  target_feature="sha2"
  target_feature="sha3"
  target_feature="ssbs"
  target_feature="v8.1a"
  target_feature="v8.2a"
  target_feature="v8.3a"
  target_feature="v8.4a"
  target_feature="vh"
  target_has_atomic="128"
  target_has_atomic="16"
  target_has_atomic="32"
  target_has_atomic="64"
  target_has_atomic="8"
  target_has_atomic="ptr"
  target_has_atomic_equal_alignment="128"
  target_has_atomic_equal_alignment="16"
  target_has_atomic_equal_alignment="32"
  target_has_atomic_equal_alignment="64"
  target_has_atomic_equal_alignment="8"
  target_has_atomic_equal_alignment="ptr"
  target_has_atomic_load_store="128"
  target_has_atomic_load_store="16"
  target_has_atomic_load_store="32"
  target_has_atomic_load_store="64"
  target_has_atomic_load_store="8"
  target_has_atomic_load_store="ptr"
  target_os="macos"
  target_pointer_width="64"
  target_thread_local
  target_vendor="apple"
  unix

  --- stderr
  error: leak sanitizer is not supported for this target

  error: aborting due to previous error

@BlackHoleFox BlackHoleFox added the C-bug Category: This is a bug. label Jun 25, 2022
@thomcc thomcc added the A-sanitizers Area: Sanitizers for correctness and code quality label Jun 25, 2022
@BlackHoleFox
Copy link
Contributor Author

@rustbot label +O-macos

@rustbot rustbot added the O-macos Operating system: macOS label Jun 25, 2022
@csmoe
Copy link
Member

csmoe commented Jun 26, 2022

#88132 the doc should be fixed as leak isn't supported yet.

@ehuss
Copy link
Contributor

ehuss commented Oct 24, 2024

Doc update is at #132097.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 24, 2024
sanitizer.md: LeakSanitizer is not supported on aarch64 macOS

related to rust-lang#98473
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 24, 2024
Rollup merge of rust-lang#132097 - radiohertz:master, r=ehuss

sanitizer.md: LeakSanitizer is not supported on aarch64 macOS

related to rust-lang#98473
@madsmtm
Copy link
Contributor

madsmtm commented Nov 13, 2024

I think this issue can be closed, the docs have been updated by #132097.

Note that #121624 is still a blocker before we can re-enable it as supported.

@madsmtm madsmtm closed this as completed Jun 6, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-sanitizers Area: Sanitizers for correctness and code quality C-bug Category: This is a bug. O-macos Operating system: macOS
Projects
None yet
Development

No branches or pull requests

6 participants