ASan on macOS reporting leaks for empty bin

I have an unsafe-rich crate which does some pointer-trickery which may lead to memory leaks. I'm tracking, and fixing, leaks using ASan, but I did three things at once:

  • Updated to macOS to 12.3 Monterey (from 12.2)
  • Updated Xcode to 13.3 (from 13.2)
  • Updated to latest rust nightly

Running: RUSTFLAGS=-Zsanitizer=address ASAN_OPTIONS=detect_leaks=1 cargo +nightly run on an empty bin project:

fn main() {

.. yields 130 leaks. I'm fairly certain I used to used get 0 leaks (before the upgrades). I have a feeling this is the fault of the upgrade of macOS[*] and/or Xcode -- but with that said: Is this a known issue? And if this is all macOS leaking stuff internally, it is possible to get the LeakSanitizer to ignore certain code paths?

[*] The stacktraces contain a lot of objc_init and things mentioning Swift, so this looks like it's initializing runtimes.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.