[SERVER-7744] ReplicaSetMonitor::~ReplicaSetMonitor crash Created: 21/Nov/12  Updated: 15/Feb/13  Resolved: 06/Dec/12

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.2.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Stephen Lee Assignee: Stephen Lee
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File mongodump.crash    
Issue Links:
Depends
Duplicate
duplicates SERVER-7006 mongo tools seg fault in 2.2.0 with r... Closed
Operating System: ALL
Steps To Reproduce:

1. Start a replica set using Mongo 2.2.x.
2. Populate it with data.
3. Use mongodump --host <replSet>/<replSetMember:port>

This behavior works without crashing using Mongo 2.0.x.

Participants:

 Description   

User noticed that specifying --host <replSet>/<memberOfReplSet>:<memberOfReplSetPort> will cause mongodump and anything that uses the destructor of the ReplicaSetMonitor class to crash w/ the stack trace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5e36f7c in std::string::compare(std::string const&) const ()
   from /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/libstdc++.so.6
(gdb) bt
#0  0x00007ffff5e36f7c in std::string::compare(std::string const&) const ()
   from /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/libstdc++.so.6
#1  0x00007ffff7e74102 in operator< <char, std::char_traits<char>, std::allocator<char> > (__rhs=..., __lhs=...)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include/g++-v4/bits/basic_string.h:2419
#2  operator() (__y=..., __x=..., this=<optimized out>)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include/g++-v4/bits/stl_function.h:230
#3  _M_lower_bound (__k=..., __y=0x7ffff85fc408, __x=0x7ffff86932c0, this=<optimized out>)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include/g++-v4/bits/stl_tree.h:1004
#4  lower_bound (__k=..., this=<optimized out>)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include/g++-v4/bits/stl_tree.h:763
#5  lower_bound (__x=..., this=0x7ffff85fc400)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include/g++-v4/bits/stl_map.h:739
#6  std::map<std::string, std::vector<mongo::HostAndPort, std::allocator<mongo::HostAndPort> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::vector<mongo::HostAndPort, std::allocator<mongo::HostAndPort> > > > >::operator[] (__k=..., this=0x7ffff85fc400)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include/g++-v4/bits/stl_map.h:448
#7  0x00007ffff7e744a8 in mongo::ReplicaSetMonitor::_cacheServerAddresses_inlock (this=0x7ffff8694420)
    at src/mongo/client/dbclient_rs.cpp:260
#8  0x00007ffff7e7be5d in mongo::ReplicaSetMonitor::~ReplicaSetMonitor (this=0x7ffff8694420, 
    __in_chrg=<optimized out>) at src/mongo/client/dbclient_rs.cpp:252

Full stack trace is attached.



 Comments   
Comment by Stephen Lee [ 21/Nov/12 ]

Yeah, it might be the same. Connecting to a specific host doesn't trigger the crash. Adding the replica set name to the host string seems to trigger it.

Comment by Tad Marshall [ 21/Nov/12 ]

One crash like this that I looked at was happening at program exit, after it had finished. This may be the same as SERVER-7006.

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