[SERVER-1281] Asking for bsonsize on non-BSON objects crashes shell Created: 22/Jun/10  Updated: 12/Jul/16  Resolved: 03/Sep/11

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 1.5.3
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Doug Hudson Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
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


Operating System: ALL
Participants:

 Description   

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]



 Comments   
Comment by Eliot Horowitz (Inactive) [ 03/Sep/11 ]

This was fixed a while back, sorry for not updating sooner

Generated at Thu Feb 08 02:56:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.