Skip to content

Instantly share code, notes, and snippets.

@yihuang
Created April 24, 2012 09:13
Show Gist options
  • Save yihuang/2478154 to your computer and use it in GitHub Desktop.
Save yihuang/2478154 to your computer and use it in GitHub Desktop.
this code will make mongodb server crash.
import pymongo
db = pymongo.Connection('dev')['fund']
db.system_js.update = '''
function () {
db.test.find().forEach(function(obj) {
continue;
});
}
'''
print db.system_js.update()
'''
error messages:
Tue Apr 24 17:06:32 Backtrace:
0xa90999 0xa90f70 0x7fb5866e4f60 0x6ba8b0 0x6b7da0 0x6b9716 0x694aee 0x6b123b 0x86f4d7 0x870bbd 0x97cd04 0x97e2ff 0x940ca5 0x944574 0x8866b7 0x88dc29 0xaa33f6 0x637407 0x7fb5866dc8ba 0x7fb585c9802d
/usr/bin/mongod(_ZN5mongo10abruptQuitEi+0x399) [0xa90999]
/usr/bin/mongod(_ZN5mongo24abruptQuitWithAddrSignalEiP7siginfoPv+0x220) [0xa90f70]
/lib/libpthread.so.0(+0xef60) [0x7fb5866e4f60]
/usr/bin/mongod(JS_GetFunctionObject+0) [0x6ba8b0]
/usr/bin/mongod(_ZN5mongo9Convertor5tovalERKNS_11BSONElementE+0xa20) [0x6b7da0]
/usr/bin/mongod(_ZN5mongo7SMScope10setElementEPKcRKNS_11BSONElementE+0x46) [0x6b9716]
/usr/bin/mongod(_ZN5mongo5Scope10loadStoredEb+0x40e) [0x694aee]
/usr/bin/mongod(_ZN5mongo7SMScope12localConnectEPKc+0x20b) [0x6b123b]
/usr/bin/mongod(_ZN5mongo6dbEvalERKSsRNS_7BSONObjERNS_14BSONObjBuilderERSs+0xe7) [0x86f4d7]
/usr/bin/mongod(_ZN5mongo7CmdEval3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb+0x27d) [0x870bbd]
/usr/bin/mongod(_ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0x6a4) [0x97cd04]
/usr/bin/mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x6ff) [0x97e2ff]
/usr/bin/mongod(_ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi+0x35) [0x940ca5]
/usr/bin/mongod(_ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_+0x1724) [0x944574]
/usr/bin/mongod() [0x8866b7]
/usr/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x559) [0x88dc29]
/usr/bin/mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x76) [0xaa33f6]
/usr/bin/mongod(_ZN5mongo3pms9threadRunEPNS_13MessagingPortE+0x287) [0x637407]
/lib/libpthread.so.0(+0x68ba) [0x7fb5866dc8ba]
/lib/libc.so.6(clone+0x6d) [0x7fb585c9802d]
Logstream::get called in uninitialized state
Tue Apr 24 17:06:32 ERROR: Client::~Client _context should be null but is not; client:conn
Logstream::get called in uninitialized state
Tue Apr 24 17:06:32 ERROR: Client::shutdown not called: conn
'''
@j2labs
Copy link

j2labs commented May 25, 2012

HA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment