Operational Defect Database

BugZero found this defect 2501 days ago.

MongoDB | 375450

[SERVER-28863] Coverity analysis defect 100734: Value not atomically updated

Last update date:


Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.



Non-atomic update of a concurrently shared value Defect 100734 (STATIC_C) Checker ATOMICITY (subcategory none) File: /src/mongo/db/storage/kv/kv_storage_engine.cpp Function mongo::KVStorageEngine::dropDatabase(mongo::OperationContext *, mongo::StringData) /src/mongo/db/storage/kv/kv_storage_engine.cpp, line: 217 Locking "this->_dbsLock". stdx::lock_guard<stdx::mutex> lk(_dbsLock); /src/mongo/db/storage/kv/kv_storage_engine.cpp, line: 221 Assigning data that might be protected by the lock to "entry". entry = it->second; /src/mongo/db/storage/kv/kv_storage_engine.cpp, line: 222 Unlocking "lk._M_device". "entry" might now be unreliable because other threads can now change the data that it depends on. } /src/mongo/db/storage/kv/kv_storage_engine.cpp, line: 243 Locking "this->_dbsLock" again. stdx::lock_guard<stdx::mutex> lk(_dbsLock); /src/mongo/db/storage/kv/kv_storage_engine.cpp, line: 244 Using an unreliable value of "entry" inside the second locked section. If the data that "entry" depends on was changed by another thread, this use might be incorrect. opCtx->recoveryUnit()->registerChange(new RemoveDBChange(this, db, entry));

Top User Comments

milkie commented on Fri, 6 Oct 2017 18:50:38 +0000: This turns out to be okay because the DB lock outside this function prevents other code from removing any db's from _db while dropDatabase is running.

Additional Resources / Links


BugZero Risk Score

Coming soon



Have you been affected by this bug?


Do you know how much operational outages are costing you?

Understand the cost to your business and how BugZero can help you reduce those costs.


Login to read and write comments.

Have you ever...

had your data corrupted from a