Bug 752533

Summary: mongo always segfaults
Product: [Fedora] Fedora Reporter: Jim Meyering <meyering>
Component: mongodbAssignee: Chris Lalancette <clalancette>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: clalancette, nathaniel
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-03 18:02:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jim Meyering 2011-11-09 19:14:31 UTC
Description of problem: mongo always segfaults


Version-Release number of selected component (if applicable): mongodb-1.8.2-9.fc17.x86_64


How reproducible: every time


Steps to Reproduce:
1. run mongo
2.
3.

Actual results:
segfault

Expected results:
no segfault

Additional info:

$ gdb mongo
(gdb) r
Starting program: /usr/bin/mongo
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
MongoDB shell version: 1.8.2

Program received signal SIGSEGV, Segmentation fault.
__pthread_mutex_lock (mutex=0x30) at pthread_mutex_lock.c:51
51        unsigned int type = PTHREAD_MUTEX_TYPE (mutex);
Missing separate debuginfos, use: debuginfo-install nspr-4.9-0.1.fc17.beta3.x86_64
(gdb) bt
#0  __pthread_mutex_lock (mutex=0x30) at pthread_mutex_lock.c:51
#1  0x0000003511622fc9 in PR_Lock () from /lib64/libnspr4.so
#2  0x00000035290b3b7b in AutoLockGC (rt=<optimized out>, this=0x7fffffffd730)
    at jscntxt.h:2601
#3  js::GCHelperThread::finish (this=0x770268, rt=<optimized out>)
    at jsgc.cpp:2048
#4  0x00000035290b3d04 in js_FinishGC (rt=0x76fff0) at jsgc.cpp:869
#5  0x0000003529047076 in JSRuntime::~JSRuntime (this=0x76fff0,
    __in_chrg=<optimized out>) at jsapi.cpp:696
#6  0x00000035290471f9 in JS_Finish (rt=0x76fff0) at jsapi.cpp:763
#7  0x000000352904726a in JS_Init (maxbytes=8388608) at jsapi.cpp:753
#8  0x00000000004e6d47 in SMEngine (this=0x76ffd0)
    at scripting/engine_spidermonkey.cpp:1067
#9  mongo::ScriptEngine::setup () at scripting/engine_spidermonkey.cpp:1105
#10 0x0000000000464c2a in _main (argc=1, argv=<optimized out>)
    at shell/dbshell.cpp:665
#11 0x000000000045b4ae in main (argc=1, argv=0x7fffffffe3c8)
    at shell/dbshell.cpp:787
(gdb)

Comment 1 Jim Meyering 2011-11-09 19:20:41 UTC
This is pretty important.
Without mongo, we cannot use iwhd at all, and lots of Aeolus depends on iwhd...

Comment 2 Chris Lalancette 2011-11-29 04:14:44 UTC
Hey Jim,
     I just tried this out on updated rawhide with mongodb-1.8.2-10, and I don't get the segfault.  Granted, I didn't *do* very much with the mongo shell, but it didn't crash on me right away:

[root@localhost ~]# mongo
MongoDB shell version: 1.8.2
connecting to: test
> show dbs
admin	(empty)
local	(empty)
test	(empty)
> db.test.find(0
... )
> db.test.find()
> show collections
> use local
switched to db local
> show collections
> show users

Can you try it out again on your setup and see if you still see the problem?

Thanks,
Chris Lalancette

Comment 3 Jim Meyering 2011-11-29 09:15:16 UTC
(In reply to comment #2)
>      I just tried this out on updated rawhide with mongodb-1.8.2-10, and I
> don't get the segfault.  Granted, I didn't *do* very much with the mongo shell,
> but it didn't crash on me right away:
...
> Can you try it out again on your setup and see if you still see the problem?

The update from -9 to -10 solved the problem.  Thanks for doing that.
Now, iwhd's mongo-using tests all pass.