Whenever DBClientReplicaSet objects create connections to the nodes, it attaches the pointer to itself on the new connection. This used to be fine since the lifetime of the DBClientReplicaSet connections are guaranteed to be longer than the connection objects it creates. However, this changed with
SERVER-9788. The internal connections to the secondaries are now drawn from the pool and put back to the pool. So the life of the internal connection is now independent of the lifetime of the DBClientReplicaSet connection.
Attaching test script to demonstrate crash.