[SERVER-11561] Coverity analysis defect 11083: Data race condition (MISSING_LOCK) Created: 04/Nov/13  Updated: 11/Jul/16  Resolved: 05/Nov/13

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 2.5.4

Type: Bug Priority: Major - P3
Reporter: auto Assignee: Matt Dannenberg
Resolution: Done Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

A new defect has been detected and assigned to mattd@10gen.com in Coverity Connect http://coverity.mongodb.com//sourcebrowser.htm?projectId=10001#mergedDefectId=11083
The defect was flagged by checker MISSING_LOCK in
file /src/mongo/shell/dbshell.cpp
function quitNicely(int)
and this ticket was created by matt.kangas@10gen.com



 Comments   
Comment by auto [ 05/Nov/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-11548 SERVER-11561 grab lock when changing dbexitCalled in dbshell.cpp
Branch: master
https://github.com/mongodb/mongo/commit/f46f05426f2da3fa396099c0c73c74de6de8c2d0

Comment by Matt Kangas [ 04/Nov/13 ]

https://github.com/mongodb/mongo/blame/master/src/mongo/shell/dbshell.cpp#L170

169  void quitNicely( int sig ) {
170*   mongo::dbexitCalled = true;
171    if ( sig == SIGINT && inMultiLine ) {
172        gotInterrupted = 1;
173        return;
174    }

CID 11083 (#1 of 1): Data race condition (MISSING_LOCK)1. missing_lock: Accessing "mongo::dbexitCalled" without holding lock "mongo::shell_utils::mongoProgramOutputMutex". Elsewhere, "mongo::dbexitCalled" is accessed with "mongo::shell_utils::mongoProgramOutputMutex" held 4 out of 4 times.

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