Skip to content

Miri hangs when a test failed #2273

@RalfJung

Description

@RalfJung

When a test failed (not with UB, but with a regular assertion failure), and libtest goes to print the failed tests, something goes wrong and Miri just hangs. I am not sure if this always happens, but I just got it in crossbeam and I seem to recall @saethlin also mentioning this.

To reproduce:

Using -Zmiri-progress-report, I can tell that interpretation itself grinds to a halt -- usually it should print progress every few seconds, but it doesn't, since operations seem to start taking a lot longer. By reducing the progress interval I got this backtrace:

   --> /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/slice/mod.rs:405:20
    |
405 |         unsafe { &*index.get_unchecked(self) }
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^ progress report: current operation being executed is here
    |
    = note: inside `core::slice::<impl [u8]>::get_unchecked::<usize>` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/slice/mod.rs:405:20
    = note: inside `<core::str::lossy::Utf8LossyChunksIter as std::iter::Iterator>::next` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/str/lossy.rs:65:34
    = note: inside `std::string::String::from_utf8_lossy` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/alloc/src/string.rs:633:48
    = note: inside `test::formatters::pretty::PrettyFormatter::<std::io::Stdout>::write_results` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/formatters/pretty.rs:141:30
    = note: inside `test::formatters::pretty::PrettyFormatter::<std::io::Stdout>::write_failures` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/formatters/pretty.rs:164:9
    = note: inside `<test::formatters::pretty::PrettyFormatter<std::io::Stdout> as test::formatters::OutputFormatter>::write_run_finish` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/formatters/pretty.rs:248:17
    = note: inside `test::run_tests_console` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/console.rs:298:5
    = note: inside `test::test_main` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:113:15
    = note: inside `test::test_main_static` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/test/src/lib.rs:132:5
    = note: inside `main`

Possibly #1935 will help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-aliasingArea: This affects the aliasing model (Stacked/Tree Borrows)C-bugCategory: This is a bug.I-slowImpact: Makes Miri even slower than it already is

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions