[SERVER-61974] Call quickExit() in mongoauditdecrypt before returning from main() Created: 09/Dec/21  Updated: 29/Oct/23  Resolved: 20/Jan/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.0

Type: Bug Priority: Major - P3
Reporter: Erwin Pe Assignee: Mark Benvenuto
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.2
Sprint: Security 2022-01-24
Participants:
Linked BF Score: 27

 Description   

On Windows, an access violation may occur if the main thread returns normally from the main() function while the signal handler thread is still in the process of initializing thread local variables that require access to static global variables (e.g. ThreadContext::_handler calling Decorable::getRegistry()). This is because the windows C runtime library registers an atexit() handler that destroys the global mutex that is used to ensure that accesses to static global variables are thread-safe. If quickExit() is called instead of returning normally from main(), then it will call TerminateProcess() which simply terminates all threads without needing to run atexit() handlers.



 Comments   
Comment by Dziana Hurynovich [ 03/Feb/22 ]

Requesting backport because of new failure BFG https://buildbaron.corp.mongodb.com/ui/#/bfg/BFG-1020036

Comment by Githook User [ 20/Jan/22 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-61974 Call quickExit() in mongoauditdecrypt before returning from main()
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/b05ab5611a1495dc79605d55916a965c9b484eb2

Generated at Thu Feb 08 05:53:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.