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

Example of leak sanitizer shows no debug information (so did applying sanitizer in my own project) #12

Closed
brunoczim opened this issue Sep 3, 2018 · 2 comments

Comments

@brunoczim
Copy link

What I ran and what I got:

@bruno:lsan% RUSTFLAGS='-Z sanitizer=leak' cargo run --example rc-cycle --target x86_64-unknown-linux-gnu
   Compiling lsan v0.1.0 (file:///home/bruno/prog/rust/rust-san/lsan)                                                                                                    
    Finished dev [optimized + debuginfo] target(s) in 0.58s
     Running `target/x86_64-unknown-linux-gnu/debug/examples/rc-cycle`

=================================================================
==29114==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x55669bd75236  (/home/bruno/prog/rust/rust-san/lsan/target/x86_64-unknown-linux-gnu/debug/examples/rc-cycle+0xa236)
    #1 0x55669bd70fc5  (/home/bruno/prog/rust/rust-san/lsan/target/x86_64-unknown-linux-gnu/debug/examples/rc-cycle+0x5fc5)

SUMMARY: LeakSanitizer: 32 byte(s) leaked in 1 allocation(s).

Rust version:

@bruno:lsan% rustc --version
rustc 1.30.0-nightly (9395f0af7 2018-09-02)
@brunoczim
Copy link
Author

This solved my issue: https://stackoverflow.com/questions/24566416/how-do-i-get-line-numbers-in-the-debug-output-with-clangs-fsanitize-address

I think it is worth putting it on readme.

@hsandt
Copy link

hsandt commented Dec 27, 2018

Sorry to continue posting here, but which answer exactly solved your issue?

I tried putting ASAN_SYMBOLIZER_PATH=/usr/local/bin/llvm-symbolize-6.0 in front of the whole sanitizer command, but it didn't help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants