FS#40284 - [mongodb] shell crashes creating index

Attached to Project: Community Packages
Opened by Mike Grundy (grund) - Friday, 09 May 2014, 18:56 GMT
Last edited by Doug Newgard (Scimmia) - Sunday, 07 January 2018, 22:15 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 6
Private No

Details

Description:

The MongoDB shell crashes on a simple operation. Only happens with ArchLinux package, doesn't happen with upstream binaries.
Upstream issue: https://jira.mongodb.org/browse/SERVER-13880 . I am unsure of the cause, but can confirm that upstream has not tested with Boost 1.55 yet and is building with an older version.

Additional info:
* package version(s)
mongodb 2.6.1-1

* config and/or log files etc.


Steps to reproduce:
start mongod (mkdir test_db && mongod --dbpath ./test_db --logpath ./mongod.log --fork)

Run the mongo shell and create an index:

# mongo

MongoDB shell version: 2.6.1
connecting to: test

> db.f.insert({i:1})
WriteResult({ "nInserted" : 1 })

> db.f.ensureIndex({i:1})
2014-05-09T18:44:30.404+0000 mongo got signal 11 (Segmentation fault), stack trace:
2014-05-09T18:44:30.412+0000 0x7d5f86 0x5fccd9 0x7fe2b3b90df0 0x9c64fc 0xa33958 0xa33994 0xa34639 0xa3887b 0xa38d5a 0x9ccdfe 0x9dca4d 0x9d22e8 0x9dd126 0x9d2370 0x9dd126 0x9d2370 0x9dd126 0x9d2370 0x9dd126 0x9d2370
mongo(_ZN5mongo15printStackTraceERSo+0x26) [0x7d5f86]
mongo(_Z12quitAbruptlyi+0x109) [0x5fccd9]
/usr/lib/libc.so.6(+0x33df0) [0x7fe2b3b90df0]
mongo(_ZN2v88internal6String11WriteToFlatItEEvPS1_PT_ii+0x3bc) [0x9c64fc]
mongo(_ZN2v88internal33GenericStringUtf16CharacterStream10FillBufferEjj+0x38) [0xa33958]
mongo(_ZN2v88internal28BufferedUtf16CharacterStream9ReadBlockEv+0x34) [0xa33994]
mongo(_ZN2v88internal7Scanner20SkipMultiLineCommentEv+0x129) [0xa34639]
mongo(_ZN2v88internal7Scanner4ScanEv+0x10eb) [0xa3887b]
mongo(_ZN2v88internal7Scanner4NextEv+0x4a) [0xa38d5a]
mongo(_ZN2v88internal6Parser6ExpectENS0_5Token5ValueEPb+0x5e) [0x9ccdfe]
mongo(_ZN2v88internal6Parser10ParseBlockEPNS0_8ZoneListINS0_6HandleINS0_6StringEEEEEPb+0x31d) [0x9dca4d]
mongo(_ZN2v88internal6Parser14ParseStatementEPNS0_8ZoneListINS0_6HandleINS0_6StringEEEEEPb+0x98) [0x9d22e8]
mongo(_ZN2v88internal6Parser16ParseIfStatementEPNS0_8ZoneListINS0_6HandleINS0_6StringEEEEEPb+0x1d6) [0x9dd126]
mongo(_ZN2v88internal6Parser14ParseStatementEPNS0_8ZoneListINS0_6HandleINS0_6StringEEEEEPb+0x120) [0x9d2370]
mongo(_ZN2v88internal6Parser16ParseIfStatementEPNS0_8ZoneListINS0_6HandleINS0_6StringEEEEEPb+0x1d6) [0x9dd126]
mongo(_ZN2v88internal6Parser14ParseStatementEPNS0_8ZoneListINS0_6HandleINS0_6StringEEEEEPb+0x120) [0x9d2370]
mongo(_ZN2v88internal6Parser16ParseIfStatementEPNS0_8ZoneListINS0_6HandleINS0_6StringEEEEEPb+0x1d6) [0x9dd126]
mongo(_ZN2v88internal6Parser14ParseStatementEPNS0_8ZoneListINS0_6HandleINS0_6StringEEEEEPb+0x120) [0x9d2370]
mongo(_ZN2v88internal6Parser16ParseIfStatementEPNS0_8ZoneListINS0_6HandleINS0_6StringEEEEEPb+0x1d6) [0x9dd126]
mongo(_ZN2v88internal6Parser14ParseStatementEPNS0_8ZoneListINS0_6HandleINS0_6StringEEEEEPb+0x120) [0x9d2370]

Here are the cleaned up symbols:
mongo(mongo::printStackTrace(std::basic_ostream<char, std::char_traits<char> >&)+0x26) [0x7d5f86]
mongo(quitAbruptly(int)+0x109) [0x5fccd9]
/usr/lib/libc.so.6(+0x33df0) [0x7f358f189df0]
mongo(void v8::internal::String::WriteToFlat<unsigned short>(v8::internal::String*, unsigned short*, int, int)+0x3bc) [0x9c64fc]
mongo(v8::internal::GenericStringUtf16CharacterStream::FillBuffer(unsigned int, unsigned int)+0x38) [0xa33958]
mongo(v8::internal::BufferedUtf16CharacterStream::ReadBlock()+0x34) [0xa33994]
mongo(v8::internal::Scanner::SkipMultiLineComment()+0x129) [0xa34639]
mongo(v8::internal::Scanner::Scan()+0x10eb) [0xa3887b]
mongo(v8::internal::Scanner::Next()+0x4a) [0xa38d5a]
mongo(v8::internal::Parser::Expect(v8::internal::Token::Value, bool*)+0x5e) [0x9ccdfe]
mongo(v8::internal::Parser::ParseBlock(v8::internal::ZoneList<v8::internal::Handle<v8::internal::String> >*, bool*)+0x31d) [0x9dca4d]
mongo(v8::internal::Parser::ParseStatement(v8::internal::ZoneList<v8::internal::Handle<v8::internal::String> >*, bool*)+0x98) [0x9d22e8]
mongo(v8::internal::Parser::ParseIfStatement(v8::internal::ZoneList<v8::internal::Handle<v8::internal::String> >*, bool*)+0x1d6) [0x9dd126]
mongo(v8::internal::Parser::ParseStatement(v8::internal::ZoneList<v8::internal::Handle<v8::internal::String> >*, bool*)+0x120) [0x9d2370]
mongo(v8::internal::Parser::ParseIfStatement(v8::internal::ZoneList<v8::internal::Handle<v8::internal::String> >*, bool*)+0x1d6) [0x9dd126]
mongo(v8::internal::Parser::ParseStatement(v8::internal::ZoneList<v8::internal::Handle<v8::internal::String> >*, bool*)+0x120) [0x9d2370]
mongo(v8::internal::Parser::ParseIfStatement(v8::internal::ZoneList<v8::internal::Handle<v8::internal::String> >*, bool*)+0x1d6) [0x9dd126]
mongo(v8::internal::Parser::ParseStatement(v8::internal::ZoneList<v8::internal::Handle<v8::internal::String> >*, bool*)+0x120) [0x9d2370]
mongo(v8::internal::Parser::ParseIfStatement(v8::internal::ZoneList<v8::internal::Handle<v8::internal::String> >*, bool*)+0x1d6) [0x9dd126]
mongo(v8::internal::Parser::ParseStatement(v8::internal::ZoneList<v8::internal::Handle<v8::internal::String> >*, bool*)+0x120) [0x9d2370]
This task depends upon

Closed by  Doug Newgard (Scimmia)
Sunday, 07 January 2018, 22:15 GMT
Reason for closing:  Fixed
Comment by Valeriy Huz (ghotrix) - Sunday, 11 May 2014, 15:45 GMT
Same issue with getIndexes()
Comment by Syed Arefinul Haque (arefindk) - Monday, 12 May 2014, 10:27 GMT
I am also facing the same issue while creating index using ensureIndex() command in mongo shell.
Comment by Felix Yan (felixonmars) - Tuesday, 13 May 2014, 15:55 GMT
I've tried to build mongodb with builtin boost, it doesn't help.
Comment by Matt Kangas (mattkangas) - Tuesday, 13 May 2014, 18:01 GMT
Felix, I see your PKGBUILD also specifies --use-system-tcmalloc, --use-system-pcre, --use-system-snappy. Please try removing those and see if you can still reproduce the failure. Our upstream builds are built with "scons all", using our vendored dependencies under src/third_party.

(looking here: https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/mongodb)

I will be happy to dig into this when I have more time.

FYI: removeWerror.patch will be unnecessary as of 2.6.2. We added a scons --disable-warnings-as-errors flag in https://jira.mongodb.org/browse/SERVER-13724
Comment by Felix Yan (felixonmars) - Wednesday, 14 May 2014, 01:08 GMT
Hi Matt, I've also tried to remove all these but still getting exactly the same problem.

Random thoughts: gcc 4.9?
Comment by Felix Yan (felixonmars) - Wednesday, 14 May 2014, 16:23 GMT
So the problem is gone here if compiling with clang.

I've pushed the version as 2.6.1-2 (with all --system-* as before) to [community-testing]. Please test, thanks!
Comment by Matt Kangas (mattkangas) - Wednesday, 14 May 2014, 17:21 GMT
Felix, very interesting news. We build & test against several gcc versions from 4.2.1 to 4.8.1 plus clang, but we are not yet testing gcc 4.9. We will investigate this further.
Comment by Doug Newgard (Scimmia) - Monday, 06 July 2015, 21:10 GMT
Felix, do you want to call this fixed? Or do you consider clang a workaround?

Anyone tried a GCC build lately?
Comment by Felix Yan (felixonmars) - Tuesday, 07 July 2015, 10:03 GMT
I still consider clang a workaround. I'll try to build next MongoDB release with GCC and see if the problem persists.
Comment by Felix Yan (felixonmars) - Monday, 03 August 2015, 16:09 GMT
I have built mongodb 3.0.5 with GCC, and could not reproduce the crash anymore. I have pushed the package to [community-testing], please let me know if it works for you, too.

Loading...