[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: |