Skip to content

Consider using Miri #1

Description

@saethlin

This crate executes multiple kinds of UB. I ran into it doing a crater run for this PR: rust-lang/rust#121282 which improves the optimization of transmutes from integer to pointer types.

I haven't been able to diagnose exactly why that PR breaks this crate, because in running Miri on this crate I run into other problems that I'm not sure how to fix.

To get started with Miri, you'll need a nightly toolchain because Miri isn't available on stable yet.

rustup toolchain add nightly
rustup component add --toolchain=nightly miri

Then you can run cargo +nightly miri test, for this repo I suggest you start by adding the environment variable to disable aliasing analysis, because that will let you skip some of the more complicated forms of UB. For example, MIRIFLAGS=-Zmiri-disable-stacked-borrows cargo +nightly miri test. Miri has decent documentation in its README: https://github.com/rust-lang/miri

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions