[SERVER-59718] use-after-delete of logv2 getTenantID callback singleton Created: 01/Sep/21  Updated: 29/Oct/23  Resolved: 16/Sep/21

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

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

Issue Links:
Problem/Incident
is caused by SERVER-59463 Add Tenant ID to log lines Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Security 2021-09-20
Participants:

 Description   

Came up in cxx-discuss slack conversation. Here's the log:

If your code is running during static-duration shutdown (i.e. after main), it looks like there is a potential use-after-delete bug in introduced in SERVER-59463. https://github.com/mongodb/mongo/blame/fa7f62a123/src/mongo/logv2/log_detail.cpp#L50 That local static would be dead at some point after main exits, but while user code could still depend on it for logging.
(A StaticImmortal would fix it)



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 15/Sep/21 ]

Author:

{'name': 'Sara Golemon', 'email': 'sara.golemon@mongodb.com', 'username': 'sgolemon'}

Message: SERVER-59718 Guard tenantID callback against shutdown destruction ordering
Branch: master
https://github.com/mongodb/mongo/commit/7e319bd3940ee5f4d32d84f63c7b8516346a7c99

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