[SERVER-53137] The CurOp constructor should initialize its variables prior to being added to the stack of active CurOp objects Created: 30/Nov/20  Updated: 29/Oct/23  Resolved: 01/Dec/20

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

Type: Bug Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Gregory Wlodarek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2020-12-14
Participants:
Linked BF Score: 0

 Description   

See: https://github.com/mongodb/mongo/blob/f10e0ad7caf897b6444580d618e4a1e1577793d3/src/mongo/db/curop.cpp#L356-L371

On L356, we call the constructor on L363 to add the CurOp object onto the stack of active CurOp objects before initializing its _lockStatsBase member variable.

This is problematic as it makes the CurOp object available for external use before being fully initialized. For example, the currentOp command tries to access _lockStatsBase for all active CurOp objects.



 Comments   
Comment by Githook User [ 01/Dec/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-53137 The CurOp constructor should initialize its variables prior to being added to the stack of active CurOp objects
Branch: master
https://github.com/mongodb/mongo/commit/a2486fc9d08029b28f7341d1ed040c3d65d7214d

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