[CDRIVER-1480] Race in mongoc_log_set_handler Created: 13/Aug/16  Updated: 19/Oct/16  Resolved: 23/Aug/16

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: None
Fix Version/s: 1.5.0

Type: Bug Priority: Minor - P4
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

mongoc_log and mongoc_log_set_handler use two different pthread_once_t's to ensure one-time initialization, but they share mutable state. Multiple threads calling a mix of the two functions will race to initialize the global logging mutex, possibly initializing it more than once.



 Comments   
Comment by Githook User [ 23/Aug/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1480 race in logging system initialization
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/02175a0fc597b59743e1fa967d21990721ef27af

Generated at Wed Feb 07 21:12:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.