Skip to content

Miri complains about stacked borrow #1178

Closed
@mulimoen

Description

@mulimoen

The following snippet fails when executing with miri on the latest nightly

use ndarray::*;

fn main() {
    let a1 = arr2(&[[1.0, 2.0], [3.0, 4.0]]);
    let a2 = arr2(&[[2.0, 3.0], [4.0, 5.0]]);
    
    a1.dot(&a2);
}

and results in error: Undefined Behavior: attempting a read access using <16389> at alloc6883[0x48], but that tag does not exist in the borrow stack for this location

I am not sure whether this is a bug in ndarray or a false positive in miri

Playground link

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