[SERVER-17040] NULL pointer crash in cloneCollectionAsCapped Created: 25/Jan/15  Updated: 18/Sep/15  Resolved: 05/Feb/15

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 3.0.0-rc6
Fix Version/s: 3.0.0-rc9, 3.1.0

Type: Bug Priority: Major - P3
Reporter: Kamran K. Assignee: Geert Bosch
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Participants:

 Description   

This bug is not specific to one particular storage engine, and it does not affect 2.6.7.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fcc700 (LWP 23947)]
0x00007ffff75675c8 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) f 2
#2  0x00000000012a1197 in mongo::(anonymous namespace)::cloneCollectionAsCapped (txn=0x7ffff7fcb7c0, db=0x0, shortFrom=..., shortTo=..., size=4096, temp=false, logForReplication=true)
    at src/mongo/db/commands/collection_to_capped.cpp:60
60	        string fromNs = db->name() + "." + shortFrom;
(gdb) p db
$1 = (mongo::Database *) 0x0
(gdb) bt
#0  0x00007ffff75675c8 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x000000000114067c in std::operator+<char, std::char_traits<char>, std::allocator<char> > (__lhs=..., __rhs=0x1f83032 ".") at /usr/include/c++/4.8/bits/basic_string.h:2405
#2  0x00000000012a1197 in mongo::(anonymous namespace)::cloneCollectionAsCapped (txn=0x7ffff7fcb7c0, db=0x0, shortFrom=..., shortTo=..., size=4096, temp=false, logForReplication=true)
    at src/mongo/db/commands/collection_to_capped.cpp:60
#3  0x00000000012a2227 in mongo::CmdCloneCollectionAsCapped::run (this=0x2863ce0 <mongo::cmdCloneCollectionAsCapped>, txn=0x7ffff7fcb7c0, dbname=..., jsobj=..., errmsg=..., result=..., fromRepl=false)
    at src/mongo/db/commands/collection_to_capped.cpp:179
#4  0x0000000001332b65 in mongo::_execCommand (txn=0x7ffff7fcb7c0, c=0x2863ce0 <mongo::cmdCloneCollectionAsCapped>, dbname=..., cmdObj=..., queryOptions=0, errmsg=..., result=..., fromRepl=false)
    at src/mongo/db/dbcommands.cpp:1267
#5  0x0000000001333ae2 in mongo::Command::execCommand (txn=0x7ffff7fcb7c0, c=0x2863ce0 <mongo::cmdCloneCollectionAsCapped>, queryOptions=0, cmdns=0x33ec414 "test.$cmd", cmdObj=..., result=..., 
    fromRepl=false) at src/mongo/db/dbcommands.cpp:1483
#6  0x00000000013343c4 in mongo::_runCommands (txn=0x7ffff7fcb7c0, ns=0x33ec414 "test.$cmd", _cmdobj=..., b=..., anObjBuilder=..., fromRepl=false, queryOptions=0) at src/mongo/db/dbcommands.cpp:1558
#7  0x0000000001535e8c in mongo::runCommands (txn=0x7ffff7fcb7c0, ns=0x33ec414 "test.$cmd", jsobj=..., curop=..., b=..., anObjBuilder=..., fromRepl=false, queryOptions=0) at src/mongo/db/query/find.cpp:137
#8  0x0000000001537eb4 in mongo::runQuery (txn=0x7ffff7fcb7c0, m=..., q=..., nss=..., curop=..., result=..., fromDBDirectClient=false) at src/mongo/db/query/find.cpp:606
#9  0x000000000143e04c in mongo::receivedQuery (txn=0x7ffff7fcb7c0, c=..., dbresponse=..., m=..., fromDBDirectClient=false) at src/mongo/db/instance.cpp:220
#10 0x000000000143f1f6 in mongo::assembleResponse (txn=0x7ffff7fcb7c0, m=..., dbresponse=..., remote=..., fromDBDirectClient=false) at src/mongo/db/instance.cpp:403
#11 0x000000000113f218 in mongo::MyMessageHandler::process (this=0x30b21c8, m=..., port=0x30d9570, le=0x354c2d0) at src/mongo/db/db.cpp:206
#12 0x00000000018df52a in mongo::PortMessageServer::handleIncomingMsg (arg=0x30d9570) at src/mongo/util/net/message_server_port.cpp:230
#13 0x00007ffff7bc4182 in start_thread (arg=0x7ffff7fcc700) at pthread_create.c:312
#14 0x00007ffff6cc500d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
 


Version: 106385c21ec92a7b98bd3be498b4f2ef02fd21fa



 Comments   
Comment by Githook User [ 06/Feb/15 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-17040: fix test case for sharded case

(cherry picked from commit 8f706010430b4a12b99add9eb8c96152c64dd580)
Branch: v3.0
https://github.com/mongodb/mongo/commit/104ef7f7bea6d9798921e6c1baa9281eaf204ad1

Comment by Githook User [ 06/Feb/15 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-17040: NULL pointer crash in cloneCollectionAsCapped

(cherry picked from commit 5145903fc270db94e6a4cbfd5c956026a107e079)
Branch: v3.0
https://github.com/mongodb/mongo/commit/008c344e13c048ab3415c70505d8815898143abc

Comment by Githook User [ 06/Feb/15 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-17040: fix test case for sharded case
Branch: master
https://github.com/mongodb/mongo/commit/8f706010430b4a12b99add9eb8c96152c64dd580

Comment by Githook User [ 05/Feb/15 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-17040: NULL pointer crash in cloneCollectionAsCapped
Branch: master
https://github.com/mongodb/mongo/commit/5145903fc270db94e6a4cbfd5c956026a107e079

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