There is integer overflow in the calculation of percent completed. In cmdline/state.c countpos (32-bit) is multiplied by 100. This overflows for me at about 67% (66TB, blocksize 512). Corrections to version 11.5 attached.
Clearly, there is real potential for overflow conditions (in calculations involving countpos and/or countmax) in state.c:state_progress() (and in state_progress_end()), and OP did well to identify this.
However, I'm puzzled by his description of the circumstances under which he "had this experience". [It doesn't compute. :)]. Care to elaborate/clarify??
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But I'm not sure how OP was able to reproduce it, since it would seem to require 33 TB data disks for it to happen at 67% with blocksize 512, according to my old calculation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is integer overflow in the calculation of percent completed. In cmdline/state.c countpos (32-bit) is multiplied by 100. This overflows for me at about 67% (66TB, blocksize 512). Corrections to version 11.5 attached.
Clearly, there is real potential for overflow conditions (in calculations involving countpos and/or countmax) in
state.c:state_progress()
(and instate_progress_end()
), and OP did well to identify this.However, I'm puzzled by his description of the circumstances under which he "had this experience". [It doesn't compute. :)]. Care to elaborate/clarify??
I think it is the same thing as observed here:
https://sourceforge.net/p/snapraid/discussion/1677233/thread/bab5f97c/#7465
But I'm not sure how OP was able to reproduce it, since it would seem to require 33 TB data disks for it to happen at 67% with blocksize 512, according to my old calculation.