Skip to content

Stack overflow in triu #1615

Description

@langston-barrett

The docs don't mention this as a hazard, so I figure it's a bug: https://docs.rs/ndarray/latest/ndarray/struct.ArrayRef.html#method.triu

use ndarray::{Array2, Axis};

fn main() {
    let a: Array2<f64> = Array2::from_shape_fn((3, 4), |(i, j)| (i * 4 + j) as f64);
    let ft = a.t();
    let widened = ft.insert_axis(Axis(2));
    widened.triu(0);
}

Found using a fuzzer.

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

    buggood first issueA good issue to start contributing to ndarray!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions