-
Notifications
You must be signed in to change notification settings - Fork 352
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
Miri hangs when a test fails #1780
Comments
Lol, I don't think I ever ran Miri on a test suite that failed in a well-defined way, i.e., without causing Miri to stop during UB.^^
|
This might be related to backtrace printing; Cc @Aaron1011 |
This hangs for me with |
@Aaron1011 Are you sure? This did not hang for me with exactly |
This is not related to
|
This is probably not related to backtrace printing because this also makes Miri hang (without const BACKTRACE_TEXT: &str = "fake stack backtrace:
0: std::rt::begin_panic::<&str>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:519:12
1: foo
at hang.rs:4:5
2: foo::{closure#0}
at hang.rs:2:1
3: <[[email protected]:2:1: 5:2] as std::ops::FnOnce<()>>::call_once - shim
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
4: <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
5: test::run_test::{closure#2}
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:568:30
6: <[closure@test::run_test::{closure#2}] as std::ops::FnOnce<()>>::call_once - shim(vtable)
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
7: <std::boxed::Box<dyn std::ops::FnOnce() + std::marker::Send> as std::ops::FnOnce<()>>::call_once
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1546:9
8: <std::panic::AssertUnwindSafe<std::boxed::Box<dyn std::ops::FnOnce() + std::marker::Send>> as std::ops::FnOnce<()>>::call_once
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panic.rs:344:9
9: std::panicking::try::do_call::<std::panic::AssertUnwindSafe<std::boxed::Box<dyn std::ops::FnOnce() + std::marker::Send>>, ()>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:379:40
10: std::panicking::try::<(), std::panic::AssertUnwindSafe<std::boxed::Box<dyn std::ops::FnOnce() + std::marker::Send>>>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:343:19
11: std::panic::catch_unwind::<std::panic::AssertUnwindSafe<std::boxed::Box<dyn std::ops::FnOnce() + std::marker::Send>>, ()>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panic.rs:431:14
12: test::run_test_in_process
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:600:18
13: test::run_test::run_test_inner::{closure#0}
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:492:39
14: test::run_test::run_test_inner
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:530:13
15: test::run_test
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:564:28
16: test::run_tests::<[closure@test::run_tests_console::{closure#2}]>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:305:17
17: test::run_tests_console
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/console.rs:289:5
18: test::test_main
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:122:15
19: test::test_main_static
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:141:5
20: main
at hang.rs:1:1
21: <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
22: std::rt::lang_start::<()>::{closure#0}
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/rt.rs:49:18
23: std::ops::function::impls::<impl std::ops::FnOnce<()> for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:259:13
24: std::panicking::try::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:379:40
25: std::panicking::try::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:343:19
26: std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panic.rs:431:14
27: std::rt::lang_start_internal
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/rt.rs:34:21
28: std::rt::lang_start::<()>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/rt.rs:48:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.";
#[test]
fn foo() {
eprintln!("{}", BACKTRACE_TEXT);
panic!();
} So it's probably related to output capturing (maybe here?) in libtest, and indeed adding
fn main() {
String::from_utf8_lossy("stack backtrace:
0: std::rt::begin_panic::<&str>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:519:12
1: foo
at hang.rs:4:5
2: foo::{closure#0}
at hang.rs:2:1
3: <[[email protected]:2:1: 5:2] as std::ops::FnOnce<()>>::call_once - shim
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
4: <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
5: test::run_test::{closure#2}
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:568:30
6: <[closure@test::run_test::{closure#2}] as std::ops::FnOnce<()>>::call_once - shim(vtable)
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
7: <std::boxed::Box<dyn std::ops::FnOnce() + std::marker::Send> as std::ops::FnOnce<()>>::call_once
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1546:9
8: <std::panic::AssertUnwindSafe<std::boxed::Box<dyn std::ops::FnOnce() + std::marker::Send>> as std::ops::FnOnce<()>>::call_once
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panic.rs:344:9
9: std::panicking::try::do_call::<std::panic::AssertUnwindSafe<std::boxed::Box<dyn std::ops::FnOnce() + std::marker::Send>>, ()>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:379:40
10: std::panicking::try::<(), std::panic::AssertUnwindSafe<std::boxed::Box<dyn std::ops::FnOnce() + std::marker::Send>>>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:343:19
11: std::panic::catch_unwind::<std::panic::AssertUnwindSafe<std::boxed::Box<dyn std::ops::FnOnce() + std::marker::Send>>, ()>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panic.rs:431:14
12: test::run_test_in_process
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:600:18
13: test::run_test::run_test_inner::{closure#0}
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:492:39
14: test::run_test::run_test_inner
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:530:13
15: test::run_test
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:564:28
16: test::run_tests::<[closure@test::run_tests_console::{closure#2}]>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:305:17
17: test::run_tests_console
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/console.rs:289:5
18: test::test_main
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:122:15
19: test::test_main_static
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:141:5
20: main
at hang.rs:1:1
21: <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
22: std::rt::lang_start::<()>::{closure#0}
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/rt.rs:49:18
23: std::ops::function::impls::<impl std::ops::FnOnce<()> for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:259:13
24: std::panicking::try::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:379:40
25: std::panicking::try::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:343:19
26: std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panic.rs:431:14
27: std::rt::lang_start_internal
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/rt.rs:34:21
28: std::rt::lang_start::<()>
at /home/hyd-dev/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/rt.rs:48:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.".as_bytes());
} Minified from
|
Okay, closing as a duplicate of #1367 then. |
Given the simple library:
and then running
RUST_BACKTRACE=full MIRIFLAGS="-Zmiri-disable-isolation" cargo +nightly miri test
the output results in:
and then just infinitely hangs.
The text was updated successfully, but these errors were encountered: