[SERVER-10236] Make logging work during thread destruction Created: 17/Jul/13  Updated: 26/Sep/16  Resolved: 26/Sep/16

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

Type: Bug Priority: Major - P3
Reporter: Tad Marshall Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-9850 replsets/sync_passive.js fails on Win... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 2016-10-10
Participants:

 Description   

When a thread terminates, objects pointed to by Thread Specific Pointers (TSPs), also known as Thread Local Storage (TLS), are deleted. One of these thread-local objects is used for logging. If the logging TSP is deleted before another TSP and the later TSP tries to log anything in its destructor, this can cause a segfault.

The code should be modified to guarantee that the TSP used for logging is the last TSP to be deleted so that other thread-local objects can use the logging system during object destruction.



 Comments   
Comment by Andrew Morrow (Inactive) [ 26/Sep/16 ]

This ticket was filed to remind us to remove the workaround added in SERVER-9850. See the comment with

TODO(tad)

in this commit: https://github.com/mongodb/mongo/commit/2cf30807f82d325ef706211667cd80e008e8ca68.

However, in SERVER-14062 that workaround was removed (see https://github.com/mongodb/mongo/commit/284f942a45b877f0baecd19cbf17fc2a4e246a79#diff-96c987e2693d90345a318d2681e2c45eL122), and I am not aware of any similar restriction having been added at any point since.

Therefore, I'm closing this issue as 'Gone Away'.

Comment by Eliot Horowitz (Inactive) [ 27/Nov/13 ]

When this is done, we need to make sure to revert changes in SERVER-9850

Generated at Thu Feb 08 03:22:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.