Consistently able to cause a segmentation fault in Mongodb 1.9.1 and 1.9.2

21 views
Skip to first unread message

HWlee

unread,
Aug 17, 2011, 5:05:29 PM8/17/11
to mongodb-user
I am using the perl driver and performing updates to documents that
are within a polygon. The polygons are fairly complex shapes, and
while most of the updates run without issue, some force both mongodb
1.9.1. and 1.9.2 to segfault. Yet they worked without issue in Mongodb
1.9.0

Mongo is running on an EC2 instance with Linux 64bit.

Here is the log file output:
Wed Aug 17 16:48:09 Got signal: 11 (Segmentation fault).

Wed Aug 17 16:48:09 Backtrace:
0x9cef69 0x9cf540 0x38e180f4a0 0x6981fe 0x84fc3d 0x863865 0x879459
0x85ea9f 0x82cac7 0x88f3b3 0x893065 0x7cc2cc 0x7ce6af 0x9e19b6
0x615417 0x38e1807761 0x38e14e098d
/opt/mongodb/current/bin/mongod(_ZN5mongo10abruptQuitEi+0x399)
[0x9cef69]
/opt/mongodb/current/bin/
mongod(_ZN5mongo24abruptQuitWithAddrSignalEiP7siginfoPv+0x220)
[0x9cf540]
/lib64/libpthread.so.0() [0x38e180f4a0]
/opt/mongodb/current/bin/mongod(_ZNK5mongo5KeyV16toBsonEv+0x2e)
[0x6981fe]
/opt/mongodb/current/bin/
mongod(_ZN5mongo18IndexInterfaceImplINS_12BtreeData_V1EE5keyAtENS_7DiskLocEi
+0x8d) [0x84fc3d]
/opt/mongodb/current/bin/
mongod(_ZN5mongo13BtreeLocation9hasPrefixERKNS_7GeoHashE+0x295)
[0x863865]
/opt/mongodb/current/bin/mongod(_ZN5mongo9GeoBrowse9fillStackEiib
+0x6f9) [0x879459]
/opt/mongodb/current/bin/mongod(_ZN5mongo9GeoBrowse7advanceEv+0x26f)
[0x85ea9f]
/opt/mongodb/current/bin/mongod(_ZN5mongo11MultiCursor7advanceEv
+0x17) [0x82cac7]
/opt/mongodb/current/bin/
mongod(_ZN5mongo14_updateObjectsEbPKcRKNS_7BSONObjES2_bbbRNS_7OpDebugEPNS_11RemoveSaverE
+0x10e3) [0x88f3b3]
/opt/mongodb/current/bin/
mongod(_ZN5mongo13updateObjectsEPKcRKNS_7BSONObjES2_bbbRNS_7OpDebugE
+0x125) [0x893065]
/opt/mongodb/current/bin/
mongod(_ZN5mongo14receivedUpdateERNS_7MessageERNS_5CurOpE+0x46c)
[0x7cc2cc]
/opt/mongodb/current/bin/
mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE
+0x117f) [0x7ce6af]
/opt/mongodb/current/bin/
mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE
+0x76) [0x9e19b6]
/opt/mongodb/current/bin/
mongod(_ZN5mongo3pms9threadRunEPNS_13MessagingPortE+0x287) [0x615417]
/lib64/libpthread.so.0() [0x38e1807761]
/lib64/libc.so.6(clone+0x6d) [0x38e14e098d]

Logstream::get called in uninitialized state
Wed Aug 17 16:48:09 ERROR: Client::~Client _context should be null but
is not; client:conn
Logstream::get called in uninitialized state
Wed Aug 17 16:48:09 ERROR: Client::shutdown not called: conn


Here is an example of the query update code:
my $updates = {'$set' => {"zone" => 'XXX' }};
my $docs = $col->update($query,$updates, {'multiple' => 1, 'safe' =>
1});

And here is one of the "$query" values that will consistently cause
the above segfault in 1.9.1 and 1.9.2

my $query= { 'loc' => {'$within' => { '$polygon' => [
[-87.3127966,32.1818121600001],[-87.3170966,32.1811121600001],
[-87.3172966,32.1842121600001],[-87.3221966,32.1836121600001],
[-87.3215966,32.1863121600001],[-87.3233966,32.1887121600001],
[-87.3209965999999,32.19301216],[-87.3232965999999,32.1949121600001],
[-87.3238966,32.19681216],[-87.3255966,32.19861216],
[-87.3257966,32.1960121600001],[-87.3281966,32.1953121600001],
[-87.3299966,32.1967121600001],[-87.3321966,32.1978121600001],
[-87.3362966,32.19821216],[-87.3382966,32.19971216],
[-87.3416966,32.20021216],[-87.3444966,32.1994121600001],
[-87.3470966,32.20001216],[-87.3494966,32.19861216],
[-87.3514966,32.19861216],[-87.3544965999999,32.20071216],
[-87.3575966,32.19771216],[-87.3605966,32.19701216],
[-87.3640966,32.1976121600001],[-87.3620966,32.20161216],
[-87.3639966,32.2032121600001],[-87.3668966,32.20291216],
[-87.3676966,32.2055121600001],[-87.3710966,32.2071121600001],
[-87.3732965999999,32.21061216],[-87.3735966,32.2144121600001],
[-87.3732965999999,32.21831216],[-87.3746965999999,32.2211121600001],
[-87.3777966,32.2232121600001],[-87.3816965999999,32.22241216],
[-87.3852965999999,32.22261216],[-87.3873966,32.22351216],
[-87.3858966,32.2261121600001],[-87.3886965999999,32.2284121600001],
[-87.3878966,32.2325121600001],[-87.3896966,32.2359121600001],
[-87.3918965999999,32.2390121600001],[-87.3951966,32.23821216],
[-87.3984966,32.2386121600001],[-87.4022965999999,32.23711216],
[-87.4055966,32.2368121600001],[-87.4090965999999,32.2370121600001],
[-87.4119966,32.23961216],[-87.4137966,32.24191216],
[-87.4162966,32.24251216],[-87.4199966,32.24441216],
[-87.4233966,32.24591216],[-87.4259966,32.2494121600001],
[-87.4285965999999,32.2526121600001],[-87.4323965999999,32.25411216],
[-87.4345966,32.2556121600001],[-87.4354966,32.25751216],
[-87.4371965999999,32.25861216],[-87.4370966,32.2614121600001],
[-87.4360966,32.2646121600001],[-87.4393966,32.2660121600001],
[-87.4424966,32.26751216],[-87.4454966,32.26881216],
[-87.4479966,32.2683121600001],[-87.4504966,32.26841216],
[-87.4535966,32.26811216],[-87.4556966,32.26591216],
[-87.4581966,32.26361216],[-87.4601966,32.2637121600001],
[-87.4624966,32.2637121600001],[-87.4655966,32.26361216],
[-87.4691966,32.2640121600001],[-87.4719966,32.26411216],
[-87.4722965999999,32.2700121600001],[-87.4724965999999,32.27831216],
[-87.4729966,32.3031121600001],[-87.4729966,32.3076121600001],
[-87.4705966,32.3076121600001],[-87.4561965999999,32.30781216],
[-87.4433966,32.3079121600001],[-87.4356966,32.30801216],
[-87.4216966,32.3081121600001],[-87.4218966,32.3156121600001],
[-87.4221966,32.32971216],[-87.4225966,32.34761216],
[-87.4225966,32.3563121600001],[-87.4226965999999,32.3638121600001],
[-87.4228965999999,32.3754121600001],[-87.4227966,32.3792121600001],
[-87.4226965999999,32.3833121600001],[-87.4225966,32.3883121600001],
[-87.4223966,32.3966121600001],[-87.4223966,32.40261216],
[-87.4223966,32.4075121600001],[-87.4222966,32.41401216],
[-87.4222966,32.41671216],[-87.4223966,32.42011216],
[-87.4225966,32.43551216],[-87.4226965999999,32.4403121600001],
[-87.4226965999999,32.4456121600001],[-87.4227966,32.45381216],
[-87.4227966,32.45681216],[-87.4228965999999,32.46221216],
[-87.4228965999999,32.46491216],[-87.4229966,32.47131216],
[-87.4230966,32.4788121600001],[-87.4218966,32.48301216],
[-87.4145966,32.4829121600001],[-87.3986965999999,32.4829121600001],
[-87.3842966,32.48281216],[-87.3750965999999,32.48281216],
[-87.3720966,32.4829121600001],[-87.3627966,32.48301216],
[-87.3546966,32.48301216],[-87.3485966,32.48301216],
[-87.3375966,32.4829121600001],[-87.3330966,32.48301216],
[-87.3271966,32.4831121600001],[-87.3182965999999,32.48331216],
[-87.3117966,32.4834121600001],[-87.3024966,32.48351216],
[-87.2991966,32.4836121600001],[-87.2913966,32.48371216],
[-87.2876965999999,32.4838121600001],[-87.2828966,32.4838121600001],
[-87.2762966,32.48391216],[-87.2719966,32.48391216],
[-87.2664966,32.4840121600001],[-87.2538966,32.48421216],
[-87.2499966,32.48421216],[-87.2340966,32.48441216],
[-87.2205966,32.4870121600001],[-87.2068965999999,32.48711216],
[-87.2041966,32.48711216],[-87.1783966,32.4872121600001],
[-87.1640965999999,32.48731216],[-87.1598966,32.48731216],
[-87.1439966,32.4874121600001],[-87.1374966,32.4875121600001],
[-87.1282965999999,32.4875121600001],[-87.1249966,32.48761216],
[-87.1177966,32.4884121600001],[-87.1146965999999,32.4886121600001],
[-87.1122966,32.4890121600001],[-87.1092965999999,32.4926121600001],
[-87.1088966,32.49641216],[-87.1066966,32.4992121600001],
[-87.1044965999999,32.50141216],[-87.1019966,32.50431216],
[-87.1003966,32.50661216],[-87.1000966,32.50911216],
[-87.1001965999999,32.5114121600001],[-87.0990965999999,32.51341216],
[-87.0965965999999,32.5140121600001],[-87.0978966,32.5164121600001],
[-87.0974965999999,32.51931216],[-87.0946966,32.52151216],
[-87.0936966,32.52381216],[-87.0913965999999,32.52471216],
[-87.0905966,32.5268121600001],[-87.0899965999999,32.5291121600001],
[-87.0896966,32.53311216],[-87.0870965999999,32.53561216],
[-87.0843966,32.53741216],[-87.0813965999999,32.5375121600001],
[-87.0795965999999,32.54031216],[-87.0797966,32.5427121600001],
[-87.0780966,32.5461121600001],[-87.0776966,32.54871216],
[-87.0783966,32.5509121600001],[-87.0774966,32.5540121600001],
[-87.0775965999999,32.55751216],[-87.0808966,32.5604121600001],
[-87.0797966,32.56681216],[-87.0801966,32.5694121600001],
[-87.0788966,32.5721121600001],[-87.0753966,32.5733121600001],
[-87.0713966,32.57561216],[-87.0677966,32.57811216],
[-87.0623965999999,32.5817121600001],
[-87.0589965999999,32.5835121600001],[-87.0560966,32.5855121600001],
[-87.0538966,32.5896121600001],[-87.0504966,32.5918121600001],
[-87.0461966,32.59401216],[-87.0424965999999,32.5950121600001],
[-87.0406966,32.5984121600001],[-87.0393966,32.6014121600001],
[-87.0401965999999,32.6052121600001],[-87.0409966,32.6088121600001],
[-87.0430966,32.6109121600001],[-87.0449966,32.6133121600001],
[-87.0448966,32.6167121600001],[-87.0460965999999,32.62001216],
[-87.0460965999999,32.62321216],[-87.0463966,32.62551216],
[-87.0459966,32.6281121600001],[-87.0460965999999,32.6312121600001],
[-87.0455966,32.63431216],[-87.0452966,32.63771216],
[-87.0439966,32.63971216],[-87.0430966,32.6421121600001],
[-87.0418966,32.64491216],[-87.0406966,32.6471121600001],
[-87.0394966,32.6489121600001],[-87.0376965999999,32.6518121600001],
[-87.0353966,32.6552121600001],[-87.0336966,32.6575121600001],
[-87.0322965999999,32.6614121600001],[-87.0311966,32.66461216],
[-87.0295966,32.66781216],[-87.0311966,32.6713121600001],
[-87.0310966,32.67531216],[-87.0324965999999,32.6783121600001],
[-87.0343966,32.68071216],[-87.0352966,32.68521216],
[-87.0344966,32.6881121600001],[-87.0330966,32.6917121600001],
[-87.0323966,32.69451216],[-87.0305966,32.69861216],
[-87.0296966,32.70111216],[-87.0289966,32.70381216],
[-87.0278966,32.7076121600001],[-87.0259966,32.7107121600001],
[-87.0252966,32.7130121600001],[-87.0227965999999,32.7159121600001],
[-87.0216966,32.7193121600001],[-87.0210966,32.72151216],
[-87.0206966,32.7239121600001],[-87.0185966,32.7273121600001],
[-87.0177965999999,32.7211121600001],[-87.0176966,32.71511216],
[-87.0176966,32.7066121600001],[-87.0176966,32.6996121600001],
[-87.0176966,32.6962121600001],[-87.0176966,32.6921121600001],
[-87.0175966,32.6831121600001],[-87.0174966,32.67781216],
[-87.0175966,32.66981216],[-87.0176966,32.66331216],
[-87.0080966,32.66331216],[-87.0040966,32.66331216],
[-86.9999966,32.66331216],[-86.9876965999999,32.66351216],
[-86.9734966,32.6636121600001],[-86.9714966,32.6638121600001],
[-86.9664966,32.6638121600001],[-86.9561965999999,32.6639121600001],
[-86.9522966,32.6641121600001],[-86.9297966,32.66421216],
[-86.9227966,32.66421216],[-86.9170966,32.66371216],
[-86.9188966,32.6618121600001],[-86.9203965999999,32.65971216],
[-86.9210965999999,32.6571121600001],[-86.9205966,32.65471216],
[-86.9171966,32.65311216],[-86.9161966,32.6494121600001],
[-86.9140965999999,32.64811216],[-86.9161966,32.6464121600001],
[-86.9188966,32.6450121600001],[-86.9168966,32.64061216],
[-86.9157966,32.6378121600001],[-86.9135965999999,32.6360121600001],
[-86.9124965999999,32.63291216],[-86.9116966,32.63051216],
[-86.9113966,32.6276121600001],[-86.9121966,32.6242121600001],
[-86.9118966,32.61961216],[-86.9100966,32.61641216],
[-86.9111966,32.6124121600001],[-86.9098966,32.60941216],
[-86.9069966,32.60801216],[-86.9084966,32.6061121600001],
[-86.9069966,32.60441216],[-86.9062966,32.6009121600001],
[-86.9063965999999,32.59781216],[-86.9050966,32.59581216],
[-86.9040965999999,32.5934121600001],[-86.9052966,32.59061216],
[-86.9041966,32.5875121600001],[-86.9032966,32.5830121600001],
[-86.9013965999999,32.5798121600001],[-86.8993966,32.57721216],
[-86.9012966,32.57451216],[-86.9006965999999,32.57021216],
[-86.8983966,32.5671121600001],[-86.8992966,32.56391216],
[-86.8996966,32.5615121600001],[-86.9001966,32.55961216],
[-86.9002966,32.55691216],[-86.9029965999999,32.5549121600001],
[-86.9043966,32.55321216],[-86.9042966,32.55071216],
[-86.9055966,32.54801216],[-86.9061966,32.54421216],
[-86.9038965999999,32.5411121600001],[-86.9059966,32.5395121600001],
[-86.9059966,32.53721216],[-86.9025966,32.5363121600001],
[-86.9015965999999,32.53331216],[-86.9022965999999,32.5293121600001],
[-86.8996966,32.5257121600001],[-86.8976966,32.5237121600001],
[-86.8949966,32.5196121600001],[-86.8943965999999,32.5148121600001],
[-86.8911965999999,32.51291216],[-86.8904965999999,32.5103121600001],
[-86.8902965999999,32.50751216],[-86.8905966,32.50451216],
[-86.8895965999999,32.50181216],[-86.8869966,32.50001216],
[-86.8849966,32.4990121600001],[-86.8843965999999,32.4967121600001],
[-86.8824966,32.4952121600001],[-86.8829966,32.4913121600001],
[-86.8813966,32.48941216],[-86.8792966,32.48761216],
[-86.8799966,32.4847121600001],[-86.8822966,32.48351216],
[-86.8844966,32.4822121600001],[-86.8814965999999,32.4804121600001],
[-86.8777966,32.47871216],[-86.8773965999999,32.4764121600001],
[-86.8768966,32.4745121600001],[-86.8741965999999,32.4720121600001],
[-86.8731966,32.4689121600001],[-86.8714965999999,32.46881216],
[-86.8697966,32.46791216],[-86.8708966,32.4639121600001],
[-86.8699966,32.4616121600001],[-86.8692966,32.4584121600001],
[-86.8666966,32.4582121600001],[-86.8644965999999,32.45811216],
[-86.8621965999999,32.4558121600001],[-86.8614966,32.45381216],
[-86.8607966,32.4505121600001],[-86.8622966,32.44661216],
[-86.8651966,32.44431216],[-86.8661966,32.44071216],
[-86.8655965999999,32.4383121600001],[-86.8614966,32.4392121600001],
[-86.8579966,32.43931216],[-86.8539966,32.4388121600001],
[-86.8505966,32.4385121600001],[-86.8474965999999,32.43661216],
[-86.8438965999999,32.4335121600001],
[-86.8406965999999,32.4315121600001],[-86.8370965999999,32.43051216],
[-86.8317966,32.42941216],[-86.8283966,32.42821216],
[-86.8257966,32.4263121600001],[-86.8245966,32.4236121600001],
[-86.8273966,32.42101216],[-86.8309965999999,32.42051216],
[-86.8353966,32.4202121600001],[-86.8398966,32.4190121600001],
[-86.8436966,32.41711216],[-86.8455966,32.4147121600001],
[-86.8460966,32.4111121600001],[-86.8447965999999,32.4041121600001],
[-86.8437966,32.40041216],[-86.8423966,32.39831216],
[-86.8407966,32.3964121600001],[-86.8381965999999,32.3939121600001],
[-86.8354965999999,32.3916121600001],[-86.8338965999999,32.39001216],
[-86.8322966,32.3873121600001],[-86.8303966,32.3830121600001],
[-86.8290966,32.3808121600001],[-86.8266965999999,32.37841216],
[-86.8230966,32.37591216],[-86.8176966,32.37301216],
[-86.8153966,32.3708121600001],[-86.8123965999999,32.3647121600001],
[-86.8109966,32.36121216],[-86.8070966,32.35311216],
[-86.8073965999999,32.3486121600001],[-86.8092966,32.3455121600001],
[-86.8122966,32.3430121600001],[-86.8148965999999,32.34081216],
[-86.8169966,32.3396121600001],[-86.8238966,32.33771216],
[-86.8323966,32.33471216],[-86.8405966,32.3321121600001],
[-86.8503966,32.32751216],[-86.8504966,32.3239121600001],
[-86.8505966,32.3188121600001],[-86.8504966,32.30981216],
[-86.8403966,32.30911216],[-86.8370965999999,32.3088121600001],
[-86.8317966,32.3076121600001],[-86.8270965999999,32.3049121600001],
[-86.8297966,32.3024121600001],[-86.8324966,32.3002121600001],
[-86.8356965999999,32.29941216],[-86.8375966,32.29781216],
[-86.8398966,32.2959121600001],[-86.8427966,32.2940121600001],
[-86.8456965999999,32.29261216],[-86.8486966,32.2918121600001],
[-86.8479966,32.28921216],[-86.8497966,32.2866121600001],
[-86.8527966,32.28671216],[-86.8549965999999,32.2855121600001],
[-86.8577966,32.2837121600001],[-86.8582966,32.2812121600001],
[-86.8594965999999,32.27901216],[-86.8613966,32.2778121600001],
[-86.8634966,32.27521216],[-86.8643966,32.27201216],
[-86.8635965999999,32.2698121600001],[-86.8623966,32.26741216],
[-86.8608966,32.26591216],[-86.8584966,32.2639121600001],
[-86.8561966,32.2624121600001],[-86.8548966,32.26001216],
[-86.8545966,32.2563121600001],[-86.8520966,32.25361216],
[-86.8488966,32.2506121600001],[-86.8458965999999,32.24821216],
[-86.8426966,32.2454121600001],[-86.8410966,32.2422121600001],
[-86.8387966,32.24141216],[-86.8364966,32.2409121600001],
[-86.8338965999999,32.23821216],[-86.8306966,32.2366121600001],
[-86.8284965999999,32.23551216],[-86.8251966,32.23511216],
[-86.8199966,32.2340121600001],[-86.8158966,32.2354121600001],
[-86.8120966,32.2370121600001],[-86.8103966,32.2345121600001],
[-86.8103966,32.23171216],[-86.8102966,32.22471216],
[-86.8217966,32.22511216],[-86.8285966,32.2250121600001],
[-86.8386965999999,32.22511216],[-86.8481965999999,32.2252121600001],
[-86.8532966,32.22511216],[-86.8598966,32.2250121600001],
[-86.8631966,32.22491216],[-86.8684966,32.22491216],
[-86.8751966,32.22511216],[-86.8838966,32.22491216],
[-86.8876966,32.2250121600001],[-86.8943965999999,32.22511216],
[-86.8988965999999,32.2252121600001],[-86.9043966,32.22511216],
[-86.9082966,32.2241121600001],[-86.9086966,32.2198121600001],
[-86.9081965999999,32.20951216],[-86.9082966,32.20341216],
[-86.9083965999999,32.1996121600001],[-86.9082966,32.1976121600001],
[-86.9083965999999,32.19141216],[-86.9080966,32.18591216],
[-86.9078966,32.1824121600001],[-86.9077966,32.1793121600001],
[-86.9076966,32.1770121600001],[-86.9077966,32.17441216],
[-86.9077966,32.1695121600001],[-86.9076966,32.1664121600001],
[-86.9077966,32.1600121600001],[-86.9076966,32.15671216],
[-86.9077966,32.15451216],[-86.9077966,32.15061216],
[-86.9077966,32.13791216],[-86.9076966,32.1353121600001],
[-86.9074965999999,32.1249121600001],
[-86.9074965999999,32.1193121600001],[-86.9072965999999,32.10731216],
[-86.9070966,32.09421216],[-86.9069966,32.0896121600001],
[-86.9070966,32.0817121600001],[-86.9069966,32.07811216],
[-86.9067966,32.0705121600001],[-86.9070966,32.06271216],
[-86.9067966,32.0590121600001],[-86.9074965999999,32.04801216],
[-86.9113966,32.0479121600001],[-86.9186966,32.0479121600001],
[-86.9267966,32.0479121600001],[-86.9331966,32.0479121600001],
[-86.9438966,32.04781216],[-86.9461966,32.0477121600001],
[-86.9509965999999,32.04761216],[-86.9574966,32.0475121600001],
[-86.9596966,32.04761216],[-86.9898966,32.0472121600001],
[-86.9990966,32.0477121600001],[-87.0019966,32.0477121600001],
[-87.0089966,32.04761216],[-87.0240966,32.04761216],
[-87.0312966,32.0475121600001],[-87.0407966,32.0475121600001],
[-87.0633966,32.0474121600001],[-87.0655965999999,32.0474121600001],
[-87.0700965999999,32.0474121600001],[-87.0739966,32.0474121600001],
[-87.0809965999999,32.0474121600001],[-87.0853966,32.0474121600001],
[-87.0939966,32.04731216],[-87.0979966,32.04731216],
[-87.1184966,32.0472121600001],[-87.1239965999999,32.0474121600001],
[-87.1372966,32.04761216],[-87.1411965999999,32.04761216],
[-87.1447966,32.04761216],[-87.1760965999999,32.0475121600001],
[-87.1783966,32.04801216],[-87.1772966,32.0509121600001],
[-87.1745966,32.0527121600001],[-87.1766966,32.0565121600001],
[-87.1761966,32.05961216],[-87.1773966,32.0617121600001],
[-87.1759966,32.0633121600001],[-87.1770966,32.0651121600001],
[-87.1794965999999,32.0665121600001],[-87.1819966,32.0671121600001],
[-87.1844966,32.06701216],[-87.1880965999999,32.06821216],
[-87.1906966,32.0703121600001],[-87.1913966,32.07321216],
[-87.1926966,32.07471216],[-87.1935966,32.0765121600001],
[-87.1911966,32.0778121600001],[-87.1892966,32.08091216],
[-87.1890966,32.0834121600001],[-87.1904966,32.0851121600001],
[-87.1931966,32.08451216],[-87.1962966,32.0850121600001],
[-87.1975965999999,32.0873121600001],[-87.1996966,32.08921216],
[-87.2026966,32.0907121600001],[-87.2049966,32.09291216],
[-87.2081966,32.09191216],[-87.2116966,32.0923121600001],
[-87.2143966,32.09311216],[-87.2175966,32.0936121600001],
[-87.2203966,32.09401216],[-87.2221966,32.09491216],
[-87.2246966,32.0950121600001],[-87.2267965999999,32.09651216],
[-87.2298966,32.0988121600001],[-87.2330966,32.1013121600001],
[-87.2343966,32.1045121600001],[-87.2353965999999,32.1077121600001],
[-87.2368966,32.11031216],[-87.2359966,32.11321216],
[-87.2377966,32.1149121600001],[-87.2399966,32.1167121600001],
[-87.2428965999999,32.11911216],[-87.2452966,32.12071216],
[-87.2474966,32.12161216],[-87.2508966,32.12321216],
[-87.2532965999999,32.1231121600001],
[-87.2564965999999,32.1226121600001],[-87.2589966,32.12141216],
[-87.2609965999999,32.1242121600001],[-87.2578966,32.1276121600001],
[-87.2552966,32.1308121600001],[-87.2534965999999,32.1333121600001],
[-87.2520966,32.13661216],[-87.2517966,32.13971216],
[-87.2524966,32.14221216],[-87.2554966,32.14131216],
[-87.2581966,32.1401121600001],[-87.2577965999999,32.14361216],
[-87.2607965999999,32.1444121600001],[-87.2624966,32.1466121600001],
[-87.2654965999999,32.14561216],[-87.2688965999999,32.1442121600001],
[-87.2699966,32.14611216],[-87.2723966,32.14791216],
[-87.2759966,32.1460121600001],[-87.2796966,32.1450121600001],
[-87.2827966,32.14491216],[-87.2825966,32.14811216],
[-87.2853966,32.14951216],[-87.2836966,32.1523121600001],
[-87.2861966,32.1541121600001],[-87.2846966,32.1564121600001],
[-87.2882966,32.15791216],[-87.2890965999999,32.16221216],
[-87.2911966,32.1639121600001],[-87.2918966,32.1670121600001],
[-87.2944965999999,32.1668121600001],
[-87.2967965999999,32.1641121600001],[-87.2999966,32.1634121600001],
[-87.3021965999999,32.1650121600001],
[-87.3003965999999,32.1668121600001],
[-87.3039965999999,32.1684121600001],[-87.3051966,32.17171216],
[-87.3076966,32.1750121600001],[-87.3120966,32.1783121600001],
[-87.3127966,32.1818121600001]
]
} }, 'zone' => {'$ne' => 'XXX'} }

}
};

Mathias Stearn

unread,
Aug 17, 2011, 5:29:37 PM8/17/11
to mongodb-user
Could you attach a full log and if possible a minimum script to
reproduce?

On Aug 17, 5:05 pm, HWlee <hwl...@gmail.com> wrote:
> I am using the perl driver and performing updates to documents that
> are within a polygon.  The polygons are fairly complex shapes, and
> while most of the updates run without issue, some force both mongodb
> 1.9.1. and 1.9.2 to segfault. Yet they worked without issue in Mongodb
> 1.9.0
>
> Mongo is running on an EC2 instance with Linux 64bit.
>
> Here is the log file output:
> Wed Aug 17 16:48:09 Got signal: 11 (Segmentation fault).
>
> Wed Aug 17 16:48:09 Backtrace:
> 0x9cef69 0x9cf540 0x38e180f4a0 0x6981fe 0x84fc3d 0x863865 0x879459
> 0x85ea9f 0x82cac7 0x88f3b3 0x893065 0x7cc2cc 0x7ce6af 0x9e19b6
> 0x615417 0x38e1807761 0x38e14e098d
>  /opt/mongodb/current/bin/mongod(_ZN5mongo10abruptQuitEi+0x399)
> [0x9cef69]
>  /opt/mongodb/current/bin/
> mongod(_ZN5mongo24abruptQuitWithAddrSignalEiP7siginfoPv+0x220)
> [0x9cf540]
>  /lib64/libpthread.so.0() [0x38e180f4a0]
>  /opt/mongodb/current/bin/mongod(_ZNK5mongo5KeyV16toBsonEv+0x2e)
> [0x6981fe]
>  /opt/mongodb/current/bin/
> mongod(_ZN5mongo18IndexInterfaceImplINS_12BtreeData_V1EE5keyAtENS_7DiskLocE­i
> +0x8d) [0x84fc3d]
>  /opt/mongodb/current/bin/
> mongod(_ZN5mongo13BtreeLocation9hasPrefixERKNS_7GeoHashE+0x295)
> [0x863865]
>  /opt/mongodb/current/bin/mongod(_ZN5mongo9GeoBrowse9fillStackEiib
> +0x6f9) [0x879459]
>  /opt/mongodb/current/bin/mongod(_ZN5mongo9GeoBrowse7advanceEv+0x26f)
> [0x85ea9f]
>  /opt/mongodb/current/bin/mongod(_ZN5mongo11MultiCursor7advanceEv
> +0x17) [0x82cac7]
>  /opt/mongodb/current/bin/
> mongod(_ZN5mongo14_updateObjectsEbPKcRKNS_7BSONObjES2_bbbRNS_7OpDebugEPNS_1­1RemoveSaverE
> +0x10e3) [0x88f3b3]
>  /opt/mongodb/current/bin/
> mongod(_ZN5mongo13updateObjectsEPKcRKNS_7BSONObjES2_bbbRNS_7OpDebugE
> +0x125) [0x893065]
>  /opt/mongodb/current/bin/
> mongod(_ZN5mongo14receivedUpdateERNS_7MessageERNS_5CurOpE+0x46c)
> [0x7cc2cc]
>  /opt/mongodb/current/bin/
> mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11Hos­tAndPortE
> +0x117f) [0x7ce6af]
>  /opt/mongodb/current/bin/
> mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessa­gingPortEPNS_9LastErrorE

HWlee

unread,
Aug 17, 2011, 5:56:42 PM8/17/11
to mongodb-user
test script:

#!/usr/bin/perl

use MongoDB;
use MongoDB::OID;
use strict;

my $dsn = 'mongodb://mongodb02.devserver.net:27017';
my $dbName = 'poidev';
my $colName = 'poi';

my $conn = MongoDB::Connection->new("host" => $dsn);
my $db = $conn->$dbName;
my $col = $db->$colName;

my $testPoly = [
];


my $query = { 'loc' => {'$within' => { '$polygon' => $testPoly } },
"zone" => { '$ne' => 'ALZ046'}};
my $updates = {'$set' => {'zone' => 'ALZ046' }};
my $docs = $col->update($query,$updates, {'multiple' => 1, 'safe' =>
1});

exit;

The full log is too large, but here is a snippet from the last
restart, followed by several lines before and after running the script
above:

***** SERVER RESTARTED *****


Wed Aug 17 16:47:25 [initandlisten] MongoDB starting : pid=25222
port=27017 dbpath=/var/opt/mongodb/data/db 64-bit
host=ip-10-102-11-196
Wed Aug 17 16:47:25 [initandlisten]
Wed Aug 17 16:47:25 [initandlisten] ** NOTE: This is a development
version (1.9.2) of MongoDB.
Wed Aug 17 16:47:25 [initandlisten] ** Not recommended for
production.
Wed Aug 17 16:47:25 [initandlisten]
Wed Aug 17 16:47:25 [initandlisten] db version v1.9.2, pdfile version
4.5
Wed Aug 17 16:47:25 [initandlisten] git version:
94ce2d93733dcbc515a1325d759b8312962279db
Wed Aug 17 16:47:25 [initandlisten] build info: Linux bs-
linux64.10gen.cc 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28
EST 2009 x86_64 BOOST_LIB_VERSION=1_41
Wed Aug 17 16:47:25 [initandlisten] options: { config: "/etc/
mongodb.conf", dbpath: "/var/opt/mongodb/data/db", fork: true,
journal: "true", logappend: "true", logpath: "/var/opt/mongodb/logs/
mongodb.log", oplogSize: 1000, port: 27017, replSet: "aeris_01", rest:
"true" }
Wed Aug 17 16:47:25 [initandlisten] journal dir=/var/opt/mongodb/data/
db/journal
Wed Aug 17 16:47:25 [initandlisten] recover begin
Wed Aug 17 16:47:25 [initandlisten] recover lsn: 3158597
Wed Aug 17 16:47:25 [initandlisten] recover /var/opt/mongodb/data/db/
journal/j._0
Wed Aug 17 16:47:25 [initandlisten] recover skipping application of
section seq:0 < lsn:3158597
Wed Aug 17 16:47:25 [initandlisten] recover skipping application of
section seq:59552 < lsn:3158597
Wed Aug 17 16:47:25 [initandlisten] recover skipping application of
section seq:119167 < lsn:3158597
Wed Aug 17 16:47:25 [initandlisten] recover skipping application of
section seq:178795 < lsn:3158597
Wed Aug 17 16:47:25 [initandlisten] recover skipping application of
section seq:238406 < lsn:3158597
Wed Aug 17 16:47:26 [initandlisten] recover skipping application of
section seq:298026 < lsn:3158597
Wed Aug 17 16:47:26 [initandlisten] recover skipping application of
section seq:357646 < lsn:3158597
Wed Aug 17 16:47:26 [initandlisten] recover skipping application of
section seq:417256 < lsn:3158597
Wed Aug 17 16:47:27 [initandlisten] recover skipping application of
section seq:476867 < lsn:3158597
Wed Aug 17 16:47:27 [initandlisten] recover skipping application of
section more...
Wed Aug 17 16:47:36 [initandlisten] recover cleaning up
Wed Aug 17 16:47:36 [initandlisten] removeJournalFiles
Wed Aug 17 16:47:36 [initandlisten] recover done
Wed Aug 17 16:47:36 [initandlisten] preallocating a journal file /var/
opt/mongodb/data/db/journal/prealloc.0
Wed Aug 17 16:47:50 [initandlisten] waiting for connections on port
27017
Wed Aug 17 16:47:50 [websvr] admin web console waiting for connections
on port 28017
Wed Aug 17 16:47:50 [initandlisten] connection accepted from
127.0.0.1:48463 #1
Wed Aug 17 16:47:50 [rsStart] replSet STARTUP2
Wed Aug 17 16:47:50 [rsSync] replSet SECONDARY

... Killed other primary (via previous test script run) so this server
took over ...

Wed Aug 17 16:51:02 [rsHealthPoll] replSet member ec2-
xxx.compute-1.amazonaws.com:27017 is now in state DOWN
Wed Aug 17 16:51:02 [rsMgr] replSet info electSelf 1
Wed Aug 17 16:51:02 [rsMgr] replSet PRIMARY


.. just before running the above test script, with running of test
script at 17:44:03 ...

Wed Aug 17 17:41:44 [conn214] end connection XXXX:53106
Wed Aug 17 17:41:50 [clientcursormon] mem (MB) res:563 virt:18094
mapped:8495
Wed Aug 17 17:42:44 [initandlisten] connection accepted from XXXX:
52016 #118
Wed Aug 17 17:42:44 [conn236] end connection XXXX2:52016
Wed Aug 17 17:44:02 [initandlisten] connection accepted from XXXX:
12820 #119
Wed Aug 17 17:44:03 Invalid access at address: 0

Wed Aug 17 17:44:03 Got signal: 11 (Segmentation fault).

Wed Aug 17 17:44:03 Backtrace:
0x9cef69 0x9cf540 0x38e180f4a0 0x6981fe 0x84fc3d 0x863865 0x87950b
0x85ea9f 0x82cac7 0x88f3b3 0x893065 0x7cc2cc 0x7ce6af 0x9e19b6
0x615417 0x38e1807761 0x38e14e098d
/opt/mongodb/current/bin/mongod(_ZN5mongo10abruptQuitEi+0x399)
[0x9cef69]
/opt/mongodb/current/bin/
mongod(_ZN5mongo24abruptQuitWithAddrSignalEiP7siginfoPv+0x220)
[0x9cf540]
/lib64/libpthread.so.0() [0x38e180f4a0]
/opt/mongodb/current/bin/mongod(_ZNK5mongo5KeyV16toBsonEv+0x2e)
[0x6981fe]
/opt/mongodb/current/bin/
mongod(_ZN5mongo18IndexInterfaceImplINS_12BtreeData_V1EE5keyAtENS_7DiskLocEi
+0x8d) [0x84fc3d]
/opt/mongodb/current/bin/
mongod(_ZN5mongo13BtreeLocation9hasPrefixERKNS_7GeoHashE+0x295)
[0x863865]
/opt/mongodb/current/bin/mongod(_ZN5mongo9GeoBrowse9fillStackEiib
+0x7ab) [0x87950b]
/opt/mongodb/current/bin/mongod(_ZN5mongo9GeoBrowse7advanceEv+0x26f)
[0x85ea9f]
/opt/mongodb/current/bin/mongod(_ZN5mongo11MultiCursor7advanceEv
+0x17) [0x82cac7]
/opt/mongodb/current/bin/
mongod(_ZN5mongo14_updateObjectsEbPKcRKNS_7BSONObjES2_bbbRNS_7OpDebugEPNS_11RemoveSaverE
+0x10e3) [0x88f3b3]
/opt/mongodb/current/bin/
mongod(_ZN5mongo13updateObjectsEPKcRKNS_7BSONObjES2_bbbRNS_7OpDebugE
+0x125) [0x893065]
/opt/mongodb/current/bin/
mongod(_ZN5mongo14receivedUpdateERNS_7MessageERNS_5CurOpE+0x46c)
[0x7cc2cc]
/opt/mongodb/current/bin/
mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE
+0x117f) [0x7ce6af]
/opt/mongodb/current/bin/
mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE
+0x76) [0x9e19b6]
/opt/mongodb/current/bin/
mongod(_ZN5mongo3pms9threadRunEPNS_13MessagingPortE+0x287) [0x615417]
/lib64/libpthread.so.0() [0x38e1807761]
/lib64/libc.so.6(clone+0x6d) [0x38e14e098d]

Logstream::get called in uninitialized state
Wed Aug 17 17:44:03 ERROR: Client::~Client _context should be null but
is not; client:conn
Logstream::get called in uninitialized state
Wed Aug 17 17:44:03 ERROR: Client::shutdown not called: conn







dwight_10gen

unread,
Aug 17, 2011, 8:00:04 PM8/17/11
to mongodb-user
we'll investigate thanks
> [-86.8902965999999,32.50751216],[-86.8905966,32.50451216], ...
>
> read more »

Greg Studer

unread,
Aug 18, 2011, 12:00:58 PM8/18/11
to mongod...@googlegroups.com
Is it possible to reproduce this failure with a $within : $box query
on your sample data? Ran the points through a quick script, seems
like the bounds are :

[
-87.4729966,
32.0472121600001
],
[
-86.8070966,
32.7273121600001
]
]

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

Greg Studer

unread,
Aug 18, 2011, 12:08:48 PM8/18/11
to mongod...@googlegroups.com
Also, are you able to increase or decrease the index precision, and
does this remove the problem?

HWlee

unread,
Aug 18, 2011, 12:09:50 PM8/18/11
to mongodb-user
Greg,

per your request, I just testing with the following:


my $testBox = [ [
-87.4729966,
32.0472121600001
],
[
-86.8070966,
32.7273121600001
]
];
my $query = { 'loc' => {'$within' => { '$box' => $testBox } }, "zone"
=> { '$ne' => 'ALZ046'}};
my $updates = {'$set' => {'zone' => 'ALZ046' }};
my $docs = $col->update($query,$updates, {'multiple' => 1, 'safe' =>
1});

The test ran without error / segmentation fault.

HWlee

unread,
Aug 18, 2011, 6:20:10 PM8/18/11
to mongodb-user
I was able to retest with increasing the index precision to 32bits
with the same seg fault. Unfortunately time ran short and I was unable
to test a lower precision today.

Greg Studer

unread,
Aug 19, 2011, 11:48:24 AM8/19/11
to mongod...@googlegroups.com
That's fine - I was just trying to track down whether this is related
to a particular type of query search pattern - seems like it isn't
right now.

The other documents in your collection would help us reproduce and fix
this - is it possible to send us the data in that collection (you can
open a private SUPPORT ticket if you like) or ideally a small subset
which still allows you to reproduce the segfault?

Another thing to try may be rebuilding the index, to make sure the
data there is consistent.

Greg Studer

unread,
Aug 25, 2011, 5:09:39 PM8/25/11
to mongod...@googlegroups.com
Just to follow up, this is an issue with updates and geo queries, one
workaround is to try to ensure that updates do not insert large
amounts of data, or add padding to documents.

Can track progress in https://jira.mongodb.org/browse/SERVER-3688

HWlee

unread,
Aug 26, 2011, 10:38:14 AM8/26/11
to mongodb-user
Greg,

Thanks for the update. I was pulled away from that portion of the
project for a few days. If you like I can provide the the original
perl script and a mongo export of the collection if it will help.

On Aug 25, 4:09 pm, Greg Studer <g...@10gen.com> wrote:
> Just to follow up, this is an issue with updates and geo queries, one
> workaround is to try to ensure that updates do not insert large
> amounts of data, or add padding to documents.
>
> Can track progress inhttps://jira.mongodb.org/browse/SERVER-3688

Greg Studer

unread,
Aug 30, 2011, 2:43:47 PM8/30/11
to mongod...@googlegroups.com
Yes, that would be great, just attach to the ticket (or another
SUPPORT ticket if you want it to be private).
Reply all
Reply to author
Forward
0 new messages