Menu

percent done bug - overflow

Help
jeff_dwork
2021-09-02
2021-10-10
  • jeff_dwork

    jeff_dwork - 2021-09-02

    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.

     
  • UhClem

    UhClem - 2021-09-02

    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??

     
    • Leifi Plomeros

      Leifi Plomeros - 2021-10-10

      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.

       

Log in to post a comment.