-
Notifications
You must be signed in to change notification settings - Fork 12
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
Overflow risk? #35
Comments
Looks like it to me. |
you are correct |
I guess the easiest fix for this would be an explicit 64bit unsigned comparison in that spot: |
The remaining question is, are there more similar bugs lurking? |
Dunno, this is the new code from frroberts. Looking at this code again I don't think it works at all if the buffer gets filled up. If bufferSize is exceeded then buffer needs to be flushed to disk before the new data can be added, but this is not done. I have to edit my previous comment a little bit: technically the original code works, MPI can only write getMaxBytesPerRead() bytes in a single collective, and that is less than INT_MAX. |
Correct me if I am wrong, but if the buffer size is set to the maximum of 2G, then this line will overflow and misbehave if the buffer is just below the limit and if
bufferTop + size
exceeds 2G, as all of these are int.https://github.com/fmihpc/vlsv/blob/master/vlsv_writer.cpp#L788
Isn't it?
The text was updated successfully, but these errors were encountered: