[SERVER-7006] mongo tools seg fault in 2.2.0 with replica sets in connection string Created: 11/Sep/12  Updated: 11/Jul/16  Resolved: 14/Sep/12

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 2.2.0
Fix Version/s: 2.2.3, 2.3.0

Type: Bug Priority: Major - P3
Reporter: Joonas Reynders Assignee: siddharth.singh@10gen.com
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux Mint 12, CentOS 6.2


Issue Links:
Depends
is depended on by SERVER-8029 mongodump crashs on empty database Closed
Duplicate
is duplicated by SERVER-6915 Replica set connection string ("rsNam... Closed
is duplicated by SERVER-6989 mongodump segfaults when host is pass... Closed
is duplicated by SERVER-7744 ReplicaSetMonitor::~ReplicaSetMonitor... Closed
is duplicated by SERVER-8050 mongo_dump SEG FAULT with replica set Closed
is duplicated by SERVER-8043 Segmentation fault on mongodump with ... Closed
Related
related to SERVER-6922 ReplicaSetMonitor should clean itself... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Mongoimport started core dumping with replica sets when we upgraded to 2.2.0.

I can reproduce it with a local three node replica set. When importing directly to PRIMARY everything works:

mongoimport -h localhost -d test -c my_collection test.json
connected to: localhost
Tue Sep 11 10:27:55 imported 1 objects

but if the set is added to the host string then mongoimport core dumps:

mongoimport -h foo/localhost -d test -c my_collection test.json
Tue Sep 11 10:21:59 starting new replica set monitor for replica set foo with seed of localhost:27017
Tue Sep 11 10:21:59 successfully connected to seed localhost:27017 for replica set foo
Tue Sep 11 10:21:59 changing hosts to

{ 0: "localhost:27017", 1: "localhost:27019", 2: "localhost:27018" }

from foo/
Tue Sep 11 10:21:59 trying to add new host localhost:27017 to replica set foo
Tue Sep 11 10:21:59 successfully connected to new host localhost:27017 in replica set foo
Tue Sep 11 10:21:59 trying to add new host localhost:27018 to replica set foo
Tue Sep 11 10:21:59 successfully connected to new host localhost:27018 in replica set foo
Tue Sep 11 10:21:59 trying to add new host localhost:27019 to replica set foo
Tue Sep 11 10:21:59 successfully connected to new host localhost:27019 in replica set foo
Tue Sep 11 10:21:59 Primary for replica set foo changed to localhost:27017
Tue Sep 11 10:21:59 replica set monitor for replica set foo started, address is foo/localhost:27017,localhost:27018,localhost:27019
Tue Sep 11 10:21:59 [ReplicaSetMonitorWatcher] starting
connected to: foo/localhost
Tue Sep 11 10:21:59 imported 1 objects
Logstream::get called in uninitialized state
Tue Sep 11 10:21:59 deleting replica set monitor for: foo/localhost:27017,localhost:27018,localhost:27019
Segmentation fault

It does not matter what kind of json document is imported, the one shown here is trivial:

cat test.json
{"menu": {"value": "File"}}

I tried the exact same setup with Mongo 2.0.7 and everything works perfectly:

mongoimport -h foo/localhost -d test -c my_collection test.json
Tue Sep 11 10:33:06 starting new replica set monitor for replica set foo with seed of localhost
Tue Sep 11 10:33:06 successfully connected to seed localhost for replica set foo
Tue Sep 11 10:33:06 changing hosts to

{ 0: "localhost:27017", 1: "localhost:27019", 2: "localhost:27018" }

from foo/
Tue Sep 11 10:33:06 trying to add new host localhost:27017 to replica set foo
Tue Sep 11 10:33:06 successfully connected to new host localhost:27017 in replica set foo
Tue Sep 11 10:33:06 trying to add new host localhost:27018 to replica set foo
Tue Sep 11 10:33:06 successfully connected to new host localhost:27018 in replica set foo
Tue Sep 11 10:33:06 trying to add new host localhost:27019 to replica set foo
Tue Sep 11 10:33:06 successfully connected to new host localhost:27019 in replica set foo
Tue Sep 11 10:33:06 replica set monitor for replica set foo started, address is foo/localhost:27017,localhost:27018,localhost:27019
Tue Sep 11 10:33:06 [ReplicaSetMonitorWatcher] starting
connected to: foo/localhost
imported 1 objects



 Comments   
Comment by siddharth.singh@10gen.com [ 19/Sep/12 ]

https://github.com/mongodb/mongo/commit/2b48ac27f5feae6c2bdf0ec53912870a8e2ee3e9

Comment by siddharth.singh@10gen.com [ 14/Sep/12 ]

https://github.com/mongodb/mongo/commit/ca91de625f1b565f38621635f595326b70d30f37

Comment by Ian Whalen (Inactive) [ 13/Sep/12 ]

as mentioned in the linked tickets, this problem affects all of the tools.

Comment by Tad Marshall [ 12/Sep/12 ]

The crash is apparently caused by static destructors running in a non-deterministic order at program exit. So, it's ugly and shouldn't happen, but the main code logic has already exited before this happens.

Comment by aleksey [ 11/Sep/12 ]

I believe, this is duplicate of SERVER-6989, and very closely related to SERVER-6915.

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