-
Notifications
You must be signed in to change notification settings - Fork 99
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
Fixed out-of-bounds read in read_mtx() #452
Conversation
read_mtx() loads a list of (row,col) pairs, sorts them, and then inserts into the CRS structure one row at a time. The loop over entries in the current row only checked if the next entry matches the current row, but NOT that the end of the pair array has been reached. This caused an invalid read just after inserting the last entry in the matrix.
I'll run the spot check as soon as the SPMV test errors on kokkos-dev are fixed, but this is a simple enough change that it could probably be merged as is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brian-kelley Thanks !
Can you also add an issue for this, so we keep track of the fixes for next release. If you can report the spot-check, I am ok with merging if it is only the spmv ones failing. @lucbv : Can you take care of the spmv tests quickly, it is blocking any new push into KK now. |
@brian-kelley : I should have said in this particular instance, I am ok with merging even if spmv fails. We need to clean up illegal memory accesses for the customer as quickly as we can. |
@srajama1 I reproduced the error on kokkos-dev and my local workstation. |
####################################################### [ FAILED ] 2 tests, listed below: |
In general it is better to a white spot check too. |
read_mtx() loads a list of (row,col) pairs, sorts them, and then inserts
into the CRS structure one row at a time. The loop over entries in the
current row only checked if the next entry matches the current row, but NOT
that the end of the pair array has been reached. This caused an invalid
read just after inserting the last entry in the matrix.