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

verify() failure when passing empty 'query' value to runCommand

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.7
    • Affects Version/s: 3.1.6
    • Component/s: Networking
    • Labels:
    • Fully Compatible
    • ALL
    • Platform 7 08/10/15

      This bug is only fatal in debug builds. It does not affect 3.0.x.

      Repro:

      // Tested with --readMode="compatibility" and --readMode="commands"
      db.runCommand({query: ''});
      

      Backtrace:

      #0  0x00007ffff6fa020b in raise (sig=5) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
      #1  0x000000000110a020 in mongo::breakpoint () at src/mongo/util/debugger.cpp:58
      #2  0x00000000010ffeff in mongo::verifyFailed (expr=0x1a46eb0 "isABSONObj()", file=0x1a46e58 "src/mongo/bson/bsonelement.cpp", line=394) at src/mongo/util/assert_util.cpp:140
      #3  0x0000000000f04dcc in mongo::BSONElement::embeddedObject (this=0x7ffff60fd020) at src/mongo/bson/bsonelement.cpp:394
      #4  0x00000000010703f4 in mongo::rpc::(anonymous namespace)::unwrapCommand (maybeWrapped=...) at src/mongo/rpc/metadata/server_selection_metadata.cpp:66
      #5  0x0000000001070f71 in mongo::rpc::ServerSelectionMetadata::upconvert (legacyCommand=..., legacyQueryFlags=0, commandBob=0x7ffff60fd220, metadataBob=0x7ffff60fd1c0)
          at src/mongo/rpc/metadata/server_selection_metadata.cpp:220
      #6  0x000000000106ca13 in mongo::rpc::upconvertRequestMetadata (legacyCmdObj=..., queryFlags=0) at src/mongo/rpc/metadata.cpp:84
      #7  0x0000000000f41f21 in mongo::DBClientWithCommands::runCommand (this=0x7ffff0162780, dbname=..., cmd=..., info=..., options=0) at src/mongo/client/dbclient.cpp:350
      #8  0x0000000000f48520 in mongo::DBClientConnection::runCommand (this=0x7ffff0162780, dbname=..., cmd=..., info=..., options=0) at src/mongo/client/dbclient.cpp:1061
      #9  0x00000000010b149b in mongo::mozjs::MongoBase::Functions::runCommand (cx=0x7ffff0026380, args=...) at src/mongo/scripting/mozjs/mongo.cpp:116
      #10 0x00000000010b627c in mongo::mozjs::MongoBase::Functions::WRAPPER_runCommand (cx=0x7ffff0026380, argc=3, vp=0x7ffff00792e0) at src/mongo/scripting/mozjs/mongo.h:56
      #11 0x00000000013ef020 in CallJSNative (args=..., native=0x10b6200 <mongo::mozjs::MongoBase::Functions::WRAPPER_runCommand(JSContext*, unsigned int, JS::Value*)>, cx=0x7ffff0026380)
          at src/third_party/mozjs-38/extract/js/src/jscntxtinlines.h:226
      #12 js::Invoke (cx=0x7ffff0026380, args=..., construct=js::NO_CONSTRUCT) at src/third_party/mozjs-38/extract/js/src/vm/Interpreter.cpp:498
      #13 0x0000000001400461 in Interpret (cx=0x7ffff0026380, state=...) at src/third_party/mozjs-38/extract/js/src/vm/Interpreter.cpp:2602
      #14 0x00000000013eec22 in js::RunScript (cx=0x7ffff0026380, state=...) at src/third_party/mozjs-38/extract/js/src/vm/Interpreter.cpp:448
      #15 0x00000000013eff07 in js::ExecuteKernel (cx=0x7ffff0026380, script=..., scopeChainArg=..., thisv=..., type=js::EXECUTE_GLOBAL, evalInFrame=..., result=0x7ffff60ffae0)
          at src/third_party/mozjs-38/extract/js/src/vm/Interpreter.cpp:654
      #16 0x00000000013f00c6 in js::Execute (cx=0x7ffff0026380, script=..., scopeChainArg=..., rval=0x7ffff60ffae0) at src/third_party/mozjs-38/extract/js/src/vm/Interpreter.cpp:691
      #17 0x0000000001816c23 in ExecuteScript (cx=0x7ffff0026380, obj=..., scriptArg=..., rval=0x7ffff60ffae0) at src/third_party/mozjs-38/extract/js/src/jsapi.cpp:3994
      #18 0x0000000001816dcb in JS_ExecuteScript (cx=0x7ffff0026380, obj=..., scriptArg=..., rval=...) at src/third_party/mozjs-38/extract/js/src/jsapi.cpp:4010
      #19 0x0000000001099cf2 in mongo::mozjs::MozJSImplScope::exec (this=0x7ffff00008c0, code=..., name=..., printResult=false, reportError=true, assertOnError=false, timeoutMs=0)
          at src/mongo/scripting/mozjs/implscope.cpp:563
      #20 0x00000000010bf803 in mongo::mozjs::MozJSProxyScope::__lambda23::operator() (__closure=0x21f9cd0) at src/mongo/scripting/mozjs/proxyscope.cpp:205
      #21 0x00000000010c29b2 in std::_Function_handler<void(), mongo::mozjs::MozJSProxyScope::exec(mongo::StringData, const string&, bool, bool, bool, int)::__lambda23>::_M_invoke(const std::_Any_data &) (
          __functor=...) at /usr/include/c++/4.8/functional:2071
      #22 0x00000000010c5176 in std::function<void ()>::operator()() const (this=0x21fa678) at /usr/include/c++/4.8/functional:2471
      #23 0x00000000010bff23 in mongo::mozjs::MozJSProxyScope::implThread (this=0x21fa5c0) at src/mongo/scripting/mozjs/proxyscope.cpp:307
      #24 0x00000000010c6427 in std::_Mem_fn<void (mongo::mozjs::MozJSProxyScope::*)()>::operator()<, void>(mongo::mozjs::MozJSProxyScope*) const (this=0x21fada8, __object=0x21fa5c0)
          at /usr/include/c++/4.8/functional:601
      #25 0x00000000010c6377 in std::_Bind_simple<std::_Mem_fn<void (mongo::mozjs::MozJSProxyScope::*)()> (mongo::mozjs::MozJSProxyScope*)>::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x21fada0)
          at /usr/include/c++/4.8/functional:1732
      #26 0x00000000010c627f in std::_Bind_simple<std::_Mem_fn<void (mongo::mozjs::MozJSProxyScope::*)()> (mongo::mozjs::MozJSProxyScope*)>::operator()() (this=0x21fada0) at /usr/include/c++/4.8/functional:1720
      #27 0x00000000010c6218 in std::thread::_Impl<std::_Bind_simple<std::_Mem_fn<void (mongo::mozjs::MozJSProxyScope::*)()> (mongo::mozjs::MozJSProxyScope*)> >::_M_run() (this=0x21fad88)
          at /usr/include/c++/4.8/thread:115
      #28 0x00007ffff777ba40 in std::(anonymous namespace)::execute_native_thread_routine (__p=<optimized out>) at ../../../../../src/libstdc++-v3/src/c++11/thread.cc:84
      #29 0x00007ffff6f98182 in start_thread (arg=0x7ffff6100700) at pthread_create.c:312
      #30 0x00007ffff6cc547d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

            Assignee:
            adam.midvidy Adam Midvidy
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: