[SERVER-28977] Coverity analysis defect 101508: Data race condition Created: 26/Apr/17  Updated: 30/Oct/23  Resolved: 13/Jun/19

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.3.1, 4.2.3

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Zach Yam (Inactive)
Resolution: Fixed Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Execution Team 2019-06-17
Participants:

 Description   

Thread shared data is accessed without holding an appropriate lock, possibly causing a race condition

Defect 101508 (STATIC_C)
Checker MISSING_LOCK (subcategory none)
File: /src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.h
Function mongo::EphemeralForTestRecordStore::updateStatsAfterRepair(mongo::OperationContext *, long long, long long)
/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.h, line: 132
Accessing "this->_data->dataSize" without holding lock "mongo::EphemeralForTestRecordStore::Data.recordsMutex". Elsewhere, "_ZN5mongo27EphemeralForTestRecordStore4DataE.dataSize" is accessed with "mongo::EphemeralForTestRecordStore::Data.recordsMutex" held 7 out of 9 times.

            _data->dataSize = dataSize;



 Comments   
Comment by Githook User [ 13/Dec/19 ]

Author:

{'name': 'Eric Milkie', 'email': 'milkie@mongodb.com', 'username': 'milkie'}

Message: SERVER-28977 Coverity analysis defect 101508: Data race condition

(cherry picked from commit 676c69403a0b40686a3c9552c407fdea19bc92e9)
Branch: v4.2
https://github.com/mongodb/mongo/commit/2a7f11fa4cfa7720bd0747cac9125352da6c59f0

Comment by Githook User [ 13/Jun/19 ]

Author:

{'name': 'Zach Yam', 'email': 'zach.yam@mongodb.com', 'username': 'zachyam'}

Message: SERVER-28977 Coverity analysis defect 101508: Data race condition
Branch: master
https://github.com/mongodb/mongo/commit/676c69403a0b40686a3c9552c407fdea19bc92e9

Generated at Thu Feb 08 04:19:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.