[SERVER-69430] mongobridge: fix local static PseudoRandom used after destruction Created: 03/Sep/22  Updated: 29/Oct/23  Resolved: 09/Sep/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: tsan
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2022-09-19
Participants:
Linked BF Score: 35

 Description   

    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



 Comments   
Comment by Githook User [ 08/Sep/22 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-69430 mongobridge: fix local static PseudoRandom used after destruction
Branch: master
https://github.com/mongodb/mongo/commit/3933eb9f081d2460d702c55d189aed845a5a46cd

Generated at Thu Feb 08 06:13:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.