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

Passing 0 to db.collection.stats() causes server to die.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.5.4
    • Affects Version/s: None
    • Component/s: JavaScript, Shell
    • Labels:
      None
    • Environment:
      db version v1.5.3-pre-, pdfile version 4.5
      git version: 783bf1e4d7f5f9caadf73233df59f6672b47120f
      sys info: Linux domU-12-31-39-06-79-A1 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_41
    • ALL

      Executing the following from a js shell:

      db.collection_name.stats(0)

      Results in the server crashing with, e.g.:

      Tue Jun 22 17:59:42 connection accepted from 127.0.0.1:36607 #1

      Tue Jun 22 18:02:50 Got signal: 8 (Floating point exception).
      Tue Jun 22 18:02:50 Backtrace:
      0x71b299 0x7f2b2aaa8af0 0x708c4a 0x6f2851 0x6f3677 0x5a872f 0x5acd87 0x670f89 0x674060 0x71be7d 0x72e770 0x7f2b2b5ab9ca 0x7f2b2ab5b6cd
      ./mongod(_ZN5mongo10abruptQuitEi+0x399) [0x71b299]
      /lib/libc.so.6(+0x33af0) [0x7f2b2aaa8af0]
      ./mongod(_ZN5mongo15CollectionStats3runERKSsRNS_7BSONObjERSsRNS_14BSONObjBuilderEb+0x14a) [0x708c4a]
      ./mongod(_ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0x981) [0x6f2851]
      ./mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_10BufBuilderERNS_14BSONObjBuilderEbi+0x6e7) [0x6f3677]
      ./mongod(_ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_10BufBuilderERNS_14BSONObjBuilderEbi+0x3f) [0x5a872f]
      ./mongod(ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1+0x18f7) [0x5acd87]
      ./mongod() [0x670f89]
      ./mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8SockAddrE+0x1290) [0x674060]
      ./mongod(_ZN5mongo10connThreadEv+0x2cd) [0x71be7d]
      ./mongod(thread_proxy+0x80) [0x72e770]
      /lib/libpthread.so.0(+0x69ca) [0x7f2b2b5ab9ca]
      /lib/libc.so.6(clone+0x6d) [0x7f2b2ab5b6cd]
      Tue Jun 22 18:02:50 dbexit:
      Tue Jun 22 18:02:50 shutdown: going to close listening sockets...
      Tue Jun 22 18:02:50 going to close listening socket: 5
      Tue Jun 22 18:02:50 going to close listening socket: 6
      Tue Jun 22 18:02:50 going to close listening socket: 7
      Tue Jun 22 18:02:50 going to close listening socket: 8
      Tue Jun 22 18:02:50 shutdown: going to flush oplog...
      Tue Jun 22 18:02:50 shutdown: going to close sockets...
      Tue Jun 22 18:02:50 shutdown: waiting for fs preallocator...
      Tue Jun 22 18:02:50 shutdown: closing all files...
      Tue Jun 22 18:02:50 closeAllFiles() finished
      Tue Jun 22 18:02:50 shutdown: removing fs lock...
      Tue Jun 22 18:02:50 dbexit: really exiting now
      ERROR: Client::~Client _context should be NULL: conn

      Reporter understands that stats shouldn't be passed an argument, but doing this by accident shouldn't cause server to die.

      FYI the shell is issuing the following command:

      { collstats: "author_count", scale: 0.0 }

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            crudson Doug Hudson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: