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

mongobridge: fix local static PseudoRandom used after destruction

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • Service Arch 2022-09-19
    • 35

          PseudoRandom makeSeededPRNG() {
              static PseudoRandom globalPRNG(mongoBridgeGlobalParams.seed);
              return PseudoRandom(globalPRNG.nextInt64());
          }
      

      This instance will not be valid as the process is shutting down.
      Fix:

          PseudoRandom makeSeededPRNG() {
              static StaticImmortal globalPRNG = 
                  PseudoRandom(mongoBridgeGlobalParams.seed);
              return PseudoRandom(globalPRNG->nextInt64());
          }

      Caused BF-26284

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: