Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-18054

Crash when running findAndModify against non-existent collection

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.2
    • Affects Version/s: None
    • Component/s: Querying
    • Fully Compatible
    • ALL
    • Quint Iteration 3.1.2

      This crash was introduced by the changes from SERVER-16063, so it only affects very recent versions of master.

      Program received signal SIGSEGV, Segmentation fault.
      [Switching to Thread 0x7ffff43f8700 (LWP 3864)]
      0x00000000011f262d in mongo::NamespaceString::db (this=0x18) at src/mongo/db/namespace_string-inl.h:35
      35	        return _dotIndex == std::string::npos ?
      (gdb) bt
      #0  0x00000000011f262d in mongo::NamespaceString::db (this=0x18) at src/mongo/db/namespace_string-inl.h:35
      #1  0x00000000015b1a48 in mongo::(anonymous namespace)::applyProjection (txn=0x7ffff43f77e0, collection=0x0, cq=0x7fffb8007800, proj=..., allowPositional=true, ws=0x7fffb80294a0, root=...) at src/mongo/db/query/get_executor.cpp:673
      #2  0x00000000015b3787 in mongo::getExecutorUpdate (txn=0x7ffff43f77e0, collection=0x0, parsedUpdate=0x7ffff43f6650, opDebug=0x7fffb8000ff8, execOut=0x7ffff43f6500) at src/mongo/db/query/get_executor.cpp:955
      #3  0x000000000131d5c7 in mongo::CmdFindAndModify::run (this=0x292e420 <mongo::cmdFindAndModify>, txn=0x7ffff43f77e0, dbName=..., cmdObj=..., options=0, errmsg=..., result=..., fromRepl=false)
          at src/mongo/db/commands/find_and_modify.cpp:523
      #4  0x00000000013a33e1 in mongo::_execCommand (txn=0x7ffff43f77e0, c=0x292e420 <mongo::cmdFindAndModify>, dbname=..., cmdObj=..., queryOptions=0, errmsg=..., result=..., fromRepl=false) at src/mongo/db/dbcommands.cpp:1139
      #5  0x00000000013a4398 in mongo::Command::execCommand (txn=0x7ffff43f77e0, c=0x292e420 <mongo::cmdFindAndModify>, queryOptions=0, cmdns=0x7fffb8003074 "test.$cmd", cmdObj=..., result=..., fromRepl=false)
          at src/mongo/db/dbcommands.cpp:1357
      #6  0x00000000013a4cf5 in mongo::_runCommands (txn=0x7ffff43f77e0, ns=0x7fffb8003074 "test.$cmd", _cmdobj=..., b=..., anObjBuilder=..., fromRepl=false, queryOptions=0) at src/mongo/db/dbcommands.cpp:1431
      #7  0x00000000013a50cc in mongo::runCommands (txn=0x7ffff43f77e0, ns=0x7fffb8003074 "test.$cmd", jsobj=..., curop=..., b=..., anObjBuilder=..., fromRepl=false, queryOptions=0) at src/mongo/db/dbcommands.cpp:1461
      #8  0x00000000014aeebd in mongo::receivedCommand (txn=0x7ffff43f77e0, nss=..., client=..., dbResponse=..., message=...) at src/mongo/db/instance.cpp:245
      #9  0x00000000014b0294 in mongo::assembleResponse (txn=0x7ffff43f77e0, m=..., dbresponse=..., remote=...) at src/mongo/db/instance.cpp:482
      #10 0x000000000118fd7e in mongo::MyMessageHandler::process (this=0x29b4810, m=..., port=0x2a044c0, le=0x7fffb80008c0) at src/mongo/db/db.cpp:171
      #11 0x000000000197cfb2 in mongo::PortMessageServer::handleIncomingMsg (arg=0x2a044c0) at src/mongo/util/net/message_server_port.cpp:230
      #12 0x00007ffff6f98182 in start_thread (arg=0x7ffff43f8700) at pthread_create.c:312
      #13 0x00007ffff6cc547d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      
      (gdb) f 1
      #1  0x00000000015b1a48 in mongo::(anonymous namespace)::applyProjection (txn=0x7ffff43f77e0, collection=0x0, cq=0x7fffb8007800, proj=..., allowPositional=true, ws=0x7fffb80294a0, root=...) at src/mongo/db/query/get_executor.cpp:673
      673	        ProjectionStageParams params(WhereCallbackReal(txn, collection->ns().db()));
      (gdb) p collection
      $1 = (mongo::Collection *) 0x0
      

      Version: 02db7fa76

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: