We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
examples/uninitialized-read.rs
use std::mem; fn main() { let xs: [u8; 4] = unsafe { mem::uninitialized() }; let y = xs[0] + xs[1]; }
$ export CARGO_INCREMENTAL=1 $ cargo run --target x86_64-unknown-linux-gnu --example uninitialized-read Compiling msan v0.1.0 (file:///home/japaric/rust/san/msan) Finished dev [unoptimized + debuginfo] target(s) in 0.38 secs Running `target/x86_64-unknown-linux-gnu/debug/examples/uninitialized-read` # sanitizer doesn't kick in $ RUSTFLAGS="-Z sanitizer=memory" cargo run --target x86_64-unknown-linux-gnu --example uninitialized-read Compiling msan v0.1.0 (file:///home/japaric/rust/san/msan) Finished dev [unoptimized + debuginfo] target(s) in 0.38 secs Running `target/x86_64-unknown-linux-gnu/debug/examples/uninitialized-read`
$ unset CARGO_INCREMENTAL $ cargo clean $ cargo run --target x86_64-unknown-linux-gnu --example uninitialized-read Compiling msan v0.1.0 (file:///home/japaric/rust/san/msan) Finished dev [unoptimized + debuginfo] target(s) in 0.37 secs Running `target/x86_64-unknown-linux-gnu/debug/examples/uninitialized-read` # sanitizer works this time $ RUSTFLAGS="-Z sanitizer=memory" cargo run --target x86_64-unknown-linux-gnu --example uninitialized-read Compiling msan v0.1.0 (file://PWD) Finished dev [unoptimized + debuginfo] target(s) in 0.37 secs Running `target/x86_64-unknown-linux-gnu/debug/examples/uninitialized-read` ==2346==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x564db789c7da in uninitialized_read::main::h0c073cea3836efc1 $PWD/examples/uninitialized-read.rs:5 #1 0x564db7919446 in __rust_maybe_catch_panic ($PWD/target/x86_64-unknown-linux-gnu/debug/examples/uninitialized-read+0x87446) #2 0x564db7911df9 in std::rt::lang_start::h6954771f55df116b ($PWD/target/x86_64-unknown-linux-gnu/debug/examples/uninitialized-read+0x7fdf9) #3 0x564db789c8a9 in main ($PWD/target/x86_64-unknown-linux-gnu/debug/examples/uninitialized-read+0xa8a9) #4 0x7f80c46ab290 in __libc_start_main (/usr/lib/libc.so.6+0x20290) #5 0x564db789c4f9 in _start ($PWD/target/x86_64-unknown-linux-gnu/debug/examples/uninitialized-read+0xa4f9) SUMMARY: MemorySanitizer: use-of-uninitialized-value $PWD/examples/uninitialized-read.rs:5 in uninitialized_read::main::h0c073cea3836efc1 Exiting
TODO Sanitizers are not yet in tree. (cf. #38699)
cc @michaelwoerister
The text was updated successfully, but these errors were encountered:
incr-comp: track the -Z sanitizer flag
0b06db5
closes rust-lang#39611
Rollup merge of rust-lang#39993 - japaric:incr-san, r=alexcrichton
5e89830
incr-comp: track the -Z sanitizer flag closes rust-lang#39611 r? @michaelwoerister
0a950bd
Successfully merging a pull request may close this issue.
STR
examples/uninitialized-read.rs
Meta
TODO Sanitizers are not yet in tree. (cf. #38699)
cc @michaelwoerister
The text was updated successfully, but these errors were encountered: