Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug in sparse matrix nonzeros counter #954

Open
manevalex opened this issue Feb 23, 2023 · 1 comment
Open

A bug in sparse matrix nonzeros counter #954

manevalex opened this issue Feb 23, 2023 · 1 comment
Assignees
Labels

Comments

@manevalex
Copy link

Hello,
I believe that there is a bug in the num_nonzeros_ counter in the block_sparse_matrix.cc . There is a check for integer overflow in the constructor. This is OK. But this check is missing in the case where the counter is incremented e.g. in AppendRows() . As a result there are cases of num_nonzeros_ < 0 which results in undefined behavior. This problem is maybe also relevant in other types of matrices where nonzeros counter is used.

@sandwichmaker sandwichmaker self-assigned this Feb 23, 2023
@sandwichmaker
Copy link
Contributor

Thanks @manevalex I will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants