[SERVER-4855] Shell segfaults when doing db.foo.find() from quickstart Created: 02/Feb/12  Updated: 30/Mar/12  Resolved: 03/Feb/12

Status: Closed
Project: Core Server
Component/s: Shell, Stability
Affects Version/s: 2.0.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Hans-Rolf Harting Assignee: Michael A. Fiedler
Resolution: Won't Fix Votes: 0
Labels: crash
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Fedora 16 3.2.2-1.fc16.x86_64 #1 SMP Thu Jan 26 03:21:58 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux


Operating System: Linux
Participants:

 Description   

I've just tried the Quickstart from http://www.mongodb.org/display/DOCS/Quickstart+Unix and the shell crashes with a segfault:

[haro@foundation node]$ mongo
MongoDB shell version: 2.0.2
connecting to: test
> db.foo.save(

{ a : 1 }

)
> db.foo.find()
Thu Feb 2 22:55:57 mongo got signal 11 (Segmentation fault), stack trace:

Thu Feb 2 22:55:57 0x46a9ef 0x462744 0x7f2312f14300 0x4c7590 0x7f23143ab23f 0x7f23143ae55b 0x7f23143af12c 0x7f2314396360 0x7f23143a5ae5 0x7f23143a7772 0x7f231431fcb5 0x7f231431fdb2 0x7f231431fe52 0x4d0549 0x467641 0x45ebae 0x7f2312eff69d 0x461699
mongo(_ZN5mongo15printStackTraceERSo+0x1f) [0x46a9ef]
mongo(_Z12quitAbruptlyi+0x334) [0x462744]
/lib64/libc.so.6(+0x36300) [0x7f2312f14300]
mongo(_ZN5mongo14bson_enumerateEP9JSContextP8JSObject11JSIterateOpPmPl+0x130) [0x4c7590]
/usr/lib64/libmozjs185.so.1.0(+0xd923f) [0x7f23143ab23f]
/usr/lib64/libmozjs185.so.1.0(+0xdc55b) [0x7f23143ae55b]
/usr/lib64/libmozjs185.so.1.0(_Z18js_ValueToIteratorP9JSContextjPN2js5ValueE+0x5c) [0x7f23143af12c]
/usr/lib64/libmozjs185.so.1.0(+0xc4360) [0x7f2314396360]
/usr/lib64/libmozjs185.so.1.0(+0xd3ae5) [0x7f23143a5ae5]
/usr/lib64/libmozjs185.so.1.0(+0xd5772) [0x7f23143a7772]
/usr/lib64/libmozjs185.so.1.0(JS_EvaluateUCScriptForPrincipals+0xc5) [0x7f231431fcb5]
/usr/lib64/libmozjs185.so.1.0(JS_EvaluateScriptForPrincipals+0x72) [0x7f231431fdb2]
/usr/lib64/libmozjs185.so.1.0(JS_EvaluateScript+0x22) [0x7f231431fe52]
mongo(_ZN5mongo7SMScope4execERKNS_10StringDataERKSsbbbi+0xf9) [0x4d0549]
mongo(_Z5_mainiPPc+0x2001) [0x467641]
mongo(main+0x1e) [0x45ebae]
/lib64/libc.so.6(__libc_start_main+0xed) [0x7f2312eff69d]
mongo() [0x461699]

The server doesn't notice this:

[root@foundation node-v0.6.9]# mongod
mongod --help for help and startup options
Thu Feb 2 22:44:48 [initandlisten] MongoDB starting : pid=10273 port=27017 dbpath=/data/db/ 64-bit host=foundation.localdomain
Thu Feb 2 22:44:48 [initandlisten] db version v2.0.2, pdfile version 4.5
Thu Feb 2 22:44:48 [initandlisten] git version: nogitversion
Thu Feb 2 22:44:48 [initandlisten] build info: Linux x86-02.phx2.fedoraproject.org 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 BOOST_LIB_VERSION=1_47
Thu Feb 2 22:44:48 [initandlisten] options: {}
Thu Feb 2 22:44:48 [initandlisten] journal dir=/data/db/journal
Thu Feb 2 22:44:48 [initandlisten] recover : no journal files present, no recovery needed
Thu Feb 2 22:44:48 [websvr] admin web console waiting for connections on port 28017
Thu Feb 2 22:44:48 [initandlisten] waiting for connections on port 27017
Thu Feb 2 22:44:55 [initandlisten] connection accepted from 127.0.0.1:37853 #1
Thu Feb 2 22:44:57 [conn1] end connection 127.0.0.1:37853
Thu Feb 2 22:44:59 [initandlisten] connection accepted from 127.0.0.1:37854 #2
Thu Feb 2 22:45:20 [conn2] end connection 127.0.0.1:37854
Thu Feb 2 22:45:48 [clientcursormon] mem (MB) res:34 virt:905 mapped:80
Thu Feb 2 22:50:48 [clientcursormon] mem (MB) res:34 virt:905 mapped:80
Thu Feb 2 22:55:48 [clientcursormon] mem (MB) res:34 virt:905 mapped:80
Thu Feb 2 22:55:48 [initandlisten] connection accepted from 127.0.0.1:37942 #3
Thu Feb 2 22:55:57 [conn3] end connection 127.0.0.1:37942
Thu Feb 2 22:56:48 [clientcursormon] mem (MB) res:34 virt:1065 mapped:160



 Comments   
Comment by Michael A. Fiedler [ 04/Feb/12 ]

I have also tested their build, and this particular issue seems to have subsided.
Please note: builds other than the official 10gen builds may have unknown dependencies and behaviors.

Comment by Pau Aliagas [ 04/Feb/12 ]

Fixed in latest update mongodb-2.0.2-8.fc16.x86_64 (currently in updates-testing).
I've updated the open bug too, this issue can be marked as solved, thanks everybody.

Comment by Michael A. Fiedler [ 03/Feb/12 ]

Fedora bug opened here: https://bugzilla.redhat.com/show_bug.cgi?id=787246

Comment by Michael A. Fiedler [ 03/Feb/12 ]

Successfully reproduced the problem using Fedora's distribution on 3.2.2-1.fc16.x86_64 #1 SMP.
This build is not built by us, and is linked to an unsupported version of JS.

I have installed the 10gen-built RPM, as recommended here: http://www.mongodb.org/display/DOCS/CentOS+and+Fedora+Packages and confirmed that this works as expected.

I am closing this case here, as it is not an issue on our end, and will open one with Fedora.

Comment by Tad Marshall [ 03/Feb/12 ]

Our builds are statically linked with SpiderMonkey 1.7, the Fedora-built version is using dynamic linking to libmozjs185.so, so SpiderMonkey version 1.85. We could try a static build with 1.85 to narrow it down.

The SpiderMonkey 1.85 Release Notes page ( https://developer.mozilla.org/en/SpiderMonkey/1.8.5 ) has some info:

"SpiderMonkey 1.8.5 is not binary-compatible with previous releases, nor is it source-code compatible. Many JSAPI types, functions, and callback signatures have changed, though most of them still have the same names and do the same things. Applications will need significant changes ..."

Comment by Michael A. Fiedler [ 03/Feb/12 ]

Update: I can reproduce this failure, further investigation forthcoming.

Comment by Eliot Horowitz (Inactive) [ 03/Feb/12 ]

Yes - please report there - and can link back to here.
We'll have someone try that binary.

Comment by Hans-Rolf Harting [ 03/Feb/12 ]

Right, same here. The package comes from the stable fedora 16 release.
Should I report this problem over there, too? I didn't do that yet.

Comment by Pau Aliagas [ 03/Feb/12 ]

Same probem here. Installation comes from latest Fedora rpm mongodb-2.0.2-5.fc16.x86_64.

Comment by Eliot Horowitz (Inactive) [ 03/Feb/12 ]

Where did this binary come from?
Doesn't look like an official one

Generated at Thu Feb 08 03:07:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.