dwrensha / seer

symbolic execution engine for Rust
Other
345 stars 7 forks source link

Unexpected error instead of `Err(panic)` when MIR for std is present #13

Open ghost opened 6 years ago

ghost commented 6 years ago

If I add examples/base64/Xargo.toml:

[dependencies]
std = {features = ["panic_unwind", "jemalloc"]}

and try to run the example with

RUSTFLAGS="-Z always-encode-mir" xargo seer

the Err(Panic) in the output is gone and I get a different error:

ExecutionComplete { input: [116, 104, 105, 115, 32, 105, 115, 35, 64, 0, 0, 0], result: Err(NoMirFor("std::sys::unix::fast_thread_local::register_dtor::::__cxa_thread_atexit_impl")) }
as string: Ok("this is#@\u{0}\u{0}\u{0}")
hit an error. halting

I think this happens because we have MIR for the expansion of panic!(). Seer detects panics in src/terminator/mod.rs in fn call_missing_fn. Since MIR is not missing, the panic is not detected and we run into this other error.