[SERVER-174] Crash in shell Created: 21/Jul/09  Updated: 12/Jul/16  Resolved: 12/Aug/09

Status: Closed
Project: Core Server
Component/s: JavaScript, Shell, Stability
Affects Version/s: 0.9.6
Fix Version/s: 0.9.8

Type: Bug Priority: Major - P3
Reporter: Ask Bjørn Hansen Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS X


Attachments: File fail.pl    
Participants:

 Description   

Inserting the test darta with the attached script makes the shell crash when 'finding' that entry in the DB.

$ echo 'db.reports.find(

{ "_id": "nntp-3158" }

)' | /usr/local/mongodb/bin/mongo temp
MongoDB shell version: 0.9.6
url: temp
connecting to: temp
type "help" for help
> db.reports.find(

{ "_id": "nntp-3158" }

)
Tue Jul 21 12:01:10 in client mode Assertion failure s 32bit/scripting/engine_spidermonkey.cpp 323
0x49870 0x506e1 0x79f45 0x7054f 0x108023 0x107cb0 0xfae73 0xfb1e4 0xdfe3a 0xdc115 0x9d4a9 0x9d400 0x9d30a 0x7aad8 0x31f1 0x1cc6
0 mongo 0x00049870 _ZN5mongo12sayDbContextEPKc + 256
1 mongo 0x000506e1 _ZN5mongo8assertedEPKcS1_j + 337
2 mongo 0x00079f45 _ZN5mongo9Convertor5tovalERKNS_11BSONElementE + 5349
3 mongo 0x0007054f ZN5mongo16resolveBSONFieldEP9JSContextP8JSObjectljPS3 + 239
4 mongo 0x00108023 js_LookupPropertyWithFlags + 881
5 mongo 0x00107cb0 js_LookupProperty + 53
6 mongo 0x000fae73 js_ValueToIterator + 2115
7 mongo 0x000fb1e4 js_CallIteratorNext + 249
8 mongo 0x000dfe3a js_Interpret + 11620
9 mongo 0x000dc115 js_Execute + 774
10 mongo 0x0009d4a9 JS_EvaluateUCScriptForPrincipals + 167
11 mongo 0x0009d400 JS_EvaluateUCScript + 67
12 mongo 0x0009d30a JS_EvaluateScript + 108
13 mongo 0x0007aad8 _ZN5mongo7SMScope4execERKSsS2_bbbi + 920
14 mongo 0x000031f1 main + 4001
15 mongo 0x00001cc6 start + 54
terminate called after throwing an instance of 'mongo::AssertionException'
what():
Tue Jul 21 12:01:10 mongo got signal 6 (Abort trap), stack trace:
Tue Jul 21 12:01:10 0x5a57 0x9475d2bb 0xffffffff 0x947d123a 0x947dd679 0x968cd005 0x968cb10c 0x968cb14b 0x968cb261 0x5082c 0x79f45 0x7054f 0x108023 0x107cb0 0xfae73 0xfb1e4 0xdfe3a 0xdc115 0x9d4a9 0x9d400
0 mongo 0x00005a57 _Z12quitAbruptlyi + 999
1 libSystem.B.dylib 0x9475d2bb _sigtramp + 43
2 ??? 0xffffffff 0x0 + 4294967295
3 libSystem.B.dylib 0x947d123a raise + 26
4 libSystem.B.dylib 0x947dd679 abort + 73
5 libstdc++.6.dylib 0x968cd005 ZN9gnu_cxx27_verbose_terminate_handlerEv + 445
6 libstdc++.6.dylib 0x968cb10c __gxx_personality_v0 + 1108
7 libstdc++.6.dylib 0x968cb14b _ZSt9terminatev + 29
8 libstdc++.6.dylib 0x968cb261 __cxa_throw + 101
9 mongo 0x0005082c _ZN5mongo8assertedEPKcS1_j + 668
10 mongo 0x00079f45 _ZN5mongo9Convertor5tovalERKNS_11BSONElementE + 5349
11 mongo 0x0007054f ZN5mongo16resolveBSONFieldEP9JSContextP8JSObjectljPS3 + 239
12 mongo 0x00108023 js_LookupPropertyWithFlags + 881
13 mongo 0x00107cb0 js_LookupProperty + 53
14 mongo 0x000fae73 js_ValueToIterator + 2115
15 mongo 0x000fb1e4 js_CallIteratorNext + 249
16 mongo 0x000dfe3a js_Interpret + 11620
17 mongo 0x000dc115 js_Execute + 774
18 mongo 0x0009d4a9 JS_EvaluateUCScriptForPrincipals + 167
19 mongo 0x0009d400 JS_EvaluateUCScript + 67



 Comments   
Comment by Jason Sachs [ 01/Sep/09 ]

This may be affecting the PHP driver as well. I've successfully written and read binary objects to/from the database in PHP, yet when I go to retrieve them from the javascript shell I get this:

> db.datasheets.find()
%????e failed. probably invalid utf-8 string [%PDF-1.1
streamr /LZWDecodegeMaker 6.52)02 for Macintosh)
Ç?èÇ?y?j ?ê
å`h?b.?ì??ü??r9?ê?ú??é??F#æÉ?l8äî?úap?:T6âF?ß@g?Éï??y?º 3£??R?4[3?RFPú?4
PP)?IäÆi$£A)?E%CT?\5??µ??ä(ëN*?Hdéq$åA&V??±ñFùdäò,?é!?¿A??;?0i618q]
why: TypeError: malformed UTF-8 character sequence at offset 10
exception: invalid utf8

p.s. this may explain my problem in JAVA-27

Comment by Eliot Horowitz (Inactive) [ 15/Aug/09 ]

Released in 0.9.8

Comment by Kristina Chodorow (Inactive) [ 12/Aug/09 ]

Getting the newest version of the perl driver should resolve this issue. All strings will be converted to utf8 before they're saved.

Comment by Eliot Horowitz (Inactive) [ 07/Aug/09 ]

0x9F is invalid UTF-8
see: http://en.wikipedia.org/wiki/UTF-8#Invalid_byte_sequences

will make shell not crash so hard though...

Comment by Kristina Chodorow (Inactive) [ 05/Aug/09 ]

The problem is, specifically, the \x9F character in the strings.

This causes the same error with the C++ driver:

mongo::BSONObjBuilder obj;
obj.append("foo", "\x9F");
conn.insert("temp.reports", obj.done() );

Comment by Eliot Horowitz (Inactive) [ 05/Aug/09 ]

can you run the server with --objcheck probably a bug in the perl driver.
will take a look

Comment by Matt Parlane [ 05/Aug/09 ]

I can reproduce this reliably on Ubuntu 64-bit with 0.9.7. Let me know if you need any more info.

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