Skip to content

socketpair shim ICEs if passed a slice as the last argument #3231

@saethlin

Description

@saethlin

The crate socket gets the ABI of socketpair wrong. It contains a binding that looks like this:

extern "C" {
    fn socketpair(domain: i32, type_: i32, protocol: i32, sv: *mut [i32]) -> i32;
}

fn main() {
    unsafe {
        socketpair(0, 0, 0, &mut [0] as *mut [i32]);
    }
}

This ICEs Miri, instead of reporting UB which is what I'd expect. Should it report UB?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions