Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-59744

Cannot bit-shift a negative number in splitVector command

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Sharding EMEA 2021-09-20
    • 128

      jstestfuzz set a negative number for maxChunkSize in the splitVector command, which the command tries to bit shift left and runs into a runtime error. I think ensuring maxChunkSize is positive would fix the problem.

      Might also consider max long long values, wherein bit shifting might exceed the max value? Calling BSONElement::safeNumberLong() ensures we handle out of bound values for maxChunkSize, but then the code bit-shifts it further.

            Assignee:
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Reporter:
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: