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

Asking for bsonsize on non-BSON objects crashes shell

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.5.3
    • Component/s: 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

      Even though it is incorrect to ask for bson size for e.g. a cursor, doing so by accident shouldn't result in the shell crashing.

      Here is an example experienced today:

      > Object.bsonsize(db.mesh_heading_author_score.find(

      {year: 2009, heading: "Diabetes Mellitus, Type 2"}

      ))
      Assertion failure: OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_HAS_PRIVATE, at jsapi.c:2293
      Tue Jun 22 13:26:48 mongo got signal 6 (Aborted), stack trace:
      Tue Jun 22 13:26:48 0x472222 0x7f9c7e37aaf0 0x7f9c7e37aa75 0x7f9c7e37e5c0 0x618d95 0x552c2c 0x4d6142 0x599eef 0x5acee9 0x59aaa6 0x557c9f 0x557be8 0x557ad1 0x4e5ace 0x475176 0x4765b6 0x7f9c7e365c4d 0x471379
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(_Z12quitAbruptlyi+0x3c2) [0x472222]
      /lib/libc.so.6(+0x33af0) [0x7f9c7e37aaf0]
      /lib/libc.so.6(gsignal+0x35) [0x7f9c7e37aa75]
      /lib/libc.so.6(abort+0x180) [0x7f9c7e37e5c0]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo() [0x618d95]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(JS_GetPrivate+0x7e) [0x552c2c]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(ZN5mongo13bson_get_sizeEP9JSContextP8JSObjectjPlS4+0x52) [0x4d6142]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(js_Invoke+0xe65) [0x599eef]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(js_Interpret+0x11433) [0x5acee9]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(js_Execute+0x418) [0x59aaa6]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(JS_EvaluateUCScriptForPrincipals+0xb5) [0x557c9f]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(JS_EvaluateUCScript+0x5a) [0x557be8]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(JS_EvaluateScript+0x80) [0x557ad1]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(_ZN5mongo7SMScope4execERKSsS2_bbbi+0x16e) [0x4e5ace]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(_Z5_mainiPPc+0x1bf6) [0x475176]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(main+0x26) [0x4765b6]
      /lib/libc.so.6(__libc_start_main+0xfd) [0x7f9c7e365c4d]
      ./development/mongodb-linux-x86_64-2010-06-02/bin/mongo(_ZNSt15basic_streambufIcSt11char_traitsIcEE6xsputnEPKcl+0x61) [0x471379]

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

              Created:
              Updated:
              Resolved: