Skip to content

Run Miri on tests (ui? stdlib? vote now on your phones) #107974

Open

Description

Thanks to the work of @matthiaskrgr we recently found UB in a handful of ui tests. That's... pretty bad. This was found by running Miri on the tests, so we should probably do that in CI.

Some of the tests are supposed to contain UB, such as tests which are checking that our ASan support works or tests that verify that our MIR opts do not exploit things that Miri says are UB. These tests should have an annotation that verifies that Miri emits error: Undefined Behavior when run on them.

And some of our tests do not run under Miri, for various reasons. Some of them ICE due to features which are not completely supported yet in Miri, and if we don't already, we should expect that we have tests which use things that Miri does not support at all like FFI. So we should have another annotation that checks that Miri produces a non-UB kind of error.

I suspect the vast majority of tests will be good as-is, and defaulting to running Miri will reduce the amount of manual work required to start doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-miriArea: The miri toolA-testsuiteArea: The testsuite used to check the correctness of rustcT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions