[SERVER-15714] Invariant failure when running aggregation against non-existent namespace Created: 17/Oct/14  Updated: 11/Jul/16  Resolved: 20/Oct/14

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 2.7.8

Type: Bug Priority: Major - P3
Reporter: Kamran K. Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-15615 Running {listIndexes: 1} causes a seg... Closed
is related to SERVER-15642 Passing an integer as a collection na... Closed
is related to SERVER-15294 Query (read-only) paths should not tr... Closed
Operating System: ALL
Steps To Reproduce:

db.runCommand({aggregate: 1});

Participants:

 Description   

Similar to SERVER-15642 and SERVER-15615, aggregate triggers an invariant failure when run against an invalid namespace. This bug only affects recent versions of 2.7.x.

Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 0x7ffff7fce700 (LWP 14529)]
0x00007ffff7bcc20b in raise (sig=5) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
37	../nptl/sysdeps/unix/sysv/linux/pt-raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff7bcc20b in raise (sig=5) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
#1  0x00000000018816a0 in mongo::mongo_breakpoint () at src/mongo/util/debug_util.cpp:58
#2  0x000000000187823e in mongo::breakpoint () at src/mongo/util/debug_util.h:73
#3  0x00000000018770d4 in mongo::invariantFailed (msg=0x1e4f7cd "!_nss.coll().empty()", file=0x1e4f797 "src/mongo/db/client.cpp", line=223) at src/mongo/util/assert_util.cpp:145
#4  0x0000000001259f14 in mongo::AutoGetCollectionForRead::_init (this=0x7ffff7fcc610) at src/mongo/db/client.cpp:223
#5  0x0000000001259d8b in mongo::AutoGetCollectionForRead::AutoGetCollectionForRead (this=0x7ffff7fcc610, txn=0x2f9cbe0, ns=...) at src/mongo/db/client.cpp:208
#6  0x00000000012b2a20 in mongo::PipelineCommand::run (this=0x26e6ae0 <mongo::cmdPipeline>, txn=0x2f9cbe0, db=..., cmdObj=..., options=0, errmsg=..., result=..., fromRepl=false) at src/mongo/db/commands/pipeline_command.cpp:230
#7  0x00000000012fa8df in mongo::_execCommand (txn=0x2f9cbe0, c=0x26e6ae0 <mongo::cmdPipeline>, dbname=..., cmdObj=..., queryOptions=0, errmsg=..., result=..., fromRepl=false) at src/mongo/db/dbcommands.cpp:1157
#8  0x00000000012fb894 in mongo::Command::execCommand (txn=0x2f9cbe0, c=0x26e6ae0 <mongo::cmdPipeline>, queryOptions=0, cmdns=0x3695814 "test.$cmd", cmdObj=..., result=..., fromRepl=false) at src/mongo/db/dbcommands.cpp:1371
#9  0x00000000012fc1a1 in mongo::_runCommands (txn=0x2f9cbe0, ns=0x3695814 "test.$cmd", _cmdobj=..., b=..., anObjBuilder=..., fromRepl=false, queryOptions=0) at src/mongo/db/dbcommands.cpp:1447
#10 0x0000000001513cda in mongo::runCommands (txn=0x2f9cbe0, ns=0x3695814 "test.$cmd", jsobj=..., curop=..., b=..., anObjBuilder=..., fromRepl=false, queryOptions=0) at src/mongo/db/query/new_find.cpp:125
#11 0x00000000015155a4 in mongo::newRunQuery (txn=0x2f9cbe0, m=..., q=..., curop=..., result=..., fromDBDirectClient=false) at src/mongo/db/query/new_find.cpp:510
#12 0x0000000001401a67 in mongo::receivedQuery (txn=0x2f9cbe0, c=..., dbresponse=..., m=..., fromDBDirectClient=false) at src/mongo/db/instance.cpp:271
#13 0x0000000001402b88 in mongo::assembleResponse (txn=0x2f9cbe0, m=..., dbresponse=..., remote=..., fromDBDirectClient=false) at src/mongo/db/instance.cpp:444
#14 0x0000000001119272 in mongo::MyMessageHandler::process (this=0x2f3a170, m=..., port=0x2f54580, le=0x2f55ca0) at src/mongo/db/db.cpp:185
#15 0x000000000189d655 in mongo::PortMessageServer::handleIncomingMsg (arg=0x2f3e510) at src/mongo/util/net/message_server_port.cpp:234
#16 0x00007ffff7bc4182 in start_thread (arg=0x7ffff7fce700) at pthread_create.c:312
#17 0x00007ffff6cc4fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111



 Comments   
Comment by Githook User [ 27/Oct/14 ]

Author:

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

Message: SERVER-15714: Use massert on invalid db/ns lock attempt

This generally indicates a malformed command, so shouldn't shutdown server.
Branch: master
https://github.com/mongodb/mongo/commit/cb7ac23702a553ce43950451587b5788de50e5a5

Comment by Githook User [ 20/Oct/14 ]

Author:

{u'username': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: SERVER-15714: change empty collection name from invariant to massert
Branch: master
https://github.com/mongodb/mongo/commit/405882053351bcdb602ddac44f8ead8404ff9345

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