- 
    Type:Bug 
- 
    Resolution: Done
- 
    Priority:Major - P3 
- 
    Affects Version/s: None
- 
    Component/s: Internal Client, Sharding
- 
    None
- 
        ALL
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
It's possible for a thread to notifyFailure(), resetting the _master variable to -1, between the time when the _master variable is checked here and when it is actually used to access the nodes array. We need to acquire _lock to do this safely.
There may be other issues here - the _check code modifies _master without locks in other places?
- duplicates
- 
                    SERVER-5833 mongo crash -         
- Closed
 
-         
- 
                    SERVER-6245 Assertion Error: bsonobjbuilder.h:127 -         
- Closed
 
-         
- is depended on by
- 
                    SERVER-5302 Mongos Process Dying Signal 11 -         
- Closed
 
-         
- is duplicated by
- 
                    SERVER-5166 Removing replica set node can cause mongos to use already freed _nodes entry -         
- Closed
 
-         
- 
                    SERVER-7841 Segmentation faults and lost replicaset seed on rs.remove() -         
- Closed
 
-         
- is related to
- 
                    SERVER-5496 Refactor ReplicaSetMonitor to avoid duplicate work -         
- Closed
 
-         
- related to
- 
                    SERVER-5362 ReplicaSetMonitor::notifySlaveFailure not thread safe -         
- Closed
 
-         
- 
                    SERVER-5392 Consider allowing only one thread to be responsible in modifying _nodes in ReplicaSetMonitor -         
- Closed
 
-