i32 overflow when determining SVD result size

Open
#313 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
44/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
hpc

Research direction

Start at lax/src/svddc.rs lines 44-49 and reproduce the linked Rust Playground example. Inspect the other vec_uninit call sites mentioned in the issue for the same size calculation risk. Done means the affected calls handle products above i32::MAX without producing an unintended larger allocation.

Written by the indexing model from the issue text.

Description

The code linked below can overflow when any of the products is above i32::MAX, potentially leading to a much larger memory allocation than intended (example). There are a few other instances in other calls to vec_uninit

https://github.com/rust-ndarray/ndarray-linalg/blob/master/lax/src/svddc.rs#L44-L49

Dominant language
Rust
Stars
452
Forks
95
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-ndarray/ndarray-linalg

All issues in rust-ndarray/ndarray-linalg

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.