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

Poor error in ./miri run --dep when using a wrong -Zmiri flag #3976

Open
RalfJung opened this issue Oct 17, 2024 · 7 comments · Fixed by #4155
Open

Poor error in ./miri run --dep when using a wrong -Zmiri flag #3976

RalfJung opened this issue Oct 17, 2024 · 7 comments · Fixed by #4155
Labels
A-dev Area: working on Miri as a developer C-bug Category: This is a bug.

Comments

@RalfJung
Copy link
Member

RalfJung commented Oct 17, 2024

$ ./miri run tests/fail-dep/libc/socketpair-data-race.rs  -Zmiri-foo --dep
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: Errored { command: "\"/home/r/src/rust/miri/target/debug/miri\" \"--edition\" \"2021\" \"--sysroot\" \"/home/r/.cache/miri\" \"tests/fail-dep/libc/socketpair-data-race.rs\" \"-Zmiri-foo\" \"--out-dir\" \"/home/r/src/rust/miri/target/miri_ui\" \"--print=cfg\" \"--target\" \"x86_64-unknown-linux-gnu\"", errors: [], stderr: [101, 114, 114, 111, 114, 58, 32, 117, 110, 107, 110, 111, 119, 110, 32, 117, 110, 115, 116, 97, 98, 108, 101, 32, 111, 112, 116, 105, 111, 110, 58, 32, 96, 109, 105, 114, 105, 45, 102, 111, 111, 96, 10, 10], stdout: [] }
Location: tests/ui.rs:340

Showing stderr as its raw ASCII encoding isn't exactly readable. ;)

Cc @oli-obk

@RalfJung RalfJung changed the title Poor error in ./miri run --dep when using a fron -Zmiri flag Poor error in ./miri run --dep when using a wrong -Zmiri flag Nov 1, 2024
@RalfJung RalfJung added C-bug Category: This is a bug. A-dev Area: working on Miri as a developer labels Nov 1, 2024
@RalfJung
Copy link
Member Author

RalfJung commented Nov 9, 2024

This is caused by that unwrap here:

test_config.apply_custom(&mut cmd, &build_manager).unwrap();

However, as far as I can see there is no nice way to report a test_result::Errored -- the fields are private and the Debug impl produces the ugly output above. @oli-obk how is this intended to work? I can't quite figure it out...

@oli-obk
Copy link
Contributor

oli-obk commented Nov 9, 2024

I just need to fix the debug impl.

@RalfJung
Copy link
Member Author

RalfJung commented Nov 9, 2024

Ideally it can use the already existing reporting logic, would be unfortunate to have the same error reported in two different ways.

@RalfJung
Copy link
Member Author

@oli-obk this is still a problem; seems like at this point all we need is a ui_test bump?

@oli-obk
Copy link
Contributor

oli-obk commented Jan 27, 2025

Well we had #3948 but it had review requests 😛 and then I forgot about it

@oli-obk oli-obk mentioned this issue Jan 27, 2025
@RalfJung
Copy link
Member Author

Would be better to split the bump from the new feature. :) Which I think you have done now, thanks!

@RalfJung
Copy link
Member Author

RalfJung commented Jan 27, 2025

This hasn't changed at all with the bump:

The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: Errored { command: "\"/home/r/src/rust/miri/target/debug/miri\" \"--edition\" \"2021\" \"--sysroot\" \"/home/r/.cache/miri\" \"tests/pass-dep/concurrency/linux-futex.rs\" \"-Zmiri-many-seeds=0..64\" \"-Zmiri-many-seeds-keep-goingg\" \"-Zthreads=20\" \"--out-dir\" \"/home/r/src/rust/miri/target/miri_ui\" \"--print=cfg\" \"--target\" \"x86_64-unknown-linux-gnu\"", errors: [], stderr: [101, 114, 114, 111, 114, 58, 32, 117, 110, 107, 110, 111, 119, 110, 32, 117, 110, 115, 116, 97, 98, 108, 101, 32, 111, 112, 116, 105, 111, 110, 58, 32, 96, 109, 105, 114, 105, 45, 109, 97, 110, 121, 45, 115, 101, 101, 100, 115, 45, 107, 101, 101, 112, 45, 103, 111, 105, 110, 103, 103, 96, 10, 10], stdout: [] }
Location: tests/ui.rs:355

@RalfJung RalfJung reopened this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dev Area: working on Miri as a developer C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants