Skip to content

Miri cannot represent partial pointers (for byte-wise copy and partial overwrite) #2181

Closed
rust-lang/rust
#104054
@RalfJung

Description

@RalfJung

Miri's model of memory can only attach provenance to pointer-sized chunks of memory, but not to individual bytes. This leads to incorrect behavior in several situations:

  • We cannot copy a pointer one MaybeUninit<u8> at a time. In particular this affects ptr::swap_nonoverlapping.
  • We cannot overwrite some of the bytes of a pointer, but preserve provenance on the bytes that remain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-interpreterArea: affects the core interpreterC-bugCategory: This is a bug.I-false-UBImpact: makes Miri falsely report UB, i.e., a false positive (with default settings)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions