Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-21079

Server segfaults with bulk_insert of size > max_bson_size

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.0-rc1
    • Affects Version/s: 3.2.0-rc1
    • Component/s: Write Ops
    • None
    • Fully Compatible
    • ALL
    • Hide
      import pymongo
      m = pymongo.MongoClient()
      coll = m.test.coll
      batch = coll.initialize_ordered_bulk_op()
      batch.insert({'b': 1, 'a': 1})
      batch.insert({'big': 'x' * m.max_bson_size})
      batch.insert({'b': 2, 'a': 2})
      batch.execute()
      
      Show
      import pymongo m = pymongo.MongoClient() coll = m.test.coll batch = coll.initialize_ordered_bulk_op() batch.insert({'b': 1, 'a': 1}) batch.insert({'big': 'x' * m.max_bson_size}) batch.insert({'b': 2, 'a': 2}) batch.execute()
    • QuInt B (11/02/15)

      Using master as of this morning (10/22) for the server, and master of pymongo on OSX.

      Server logs look like:

      2015-10-22T15:06:34.484-0400 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=9G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
      2015-10-22T15:06:34.716-0400 I CONTROL  [initandlisten] MongoDB starting : pid=10390 port=27017 dbpath=testdata 64-bit host=mongodb-4.local
      2015-10-22T15:06:34.716-0400 I CONTROL  [initandlisten] db version v3.2.0-rc1-pre-
      2015-10-22T15:06:34.716-0400 I CONTROL  [initandlisten] git version: 737bb20fcb9176eb5f664bd874cdaece779d4012
      2015-10-22T15:06:34.716-0400 I CONTROL  [initandlisten] allocator: system
      2015-10-22T15:06:34.717-0400 I CONTROL  [initandlisten] modules: none
      2015-10-22T15:06:34.717-0400 I CONTROL  [initandlisten] build environment:
      2015-10-22T15:06:34.717-0400 I CONTROL  [initandlisten]     distarch: x86_64
      2015-10-22T15:06:34.717-0400 I CONTROL  [initandlisten]     target_arch: x86_64
      2015-10-22T15:06:34.717-0400 I CONTROL  [initandlisten] options: { storage: { dbPath: "testdata" } }
      2015-10-22T15:06:34.717-0400 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
      2015-10-22T15:06:34.717-0400 I FTDC     [initandlisten] Starting full-time diagnostic data capture with directory 'testdata/diagnostic.data'
      2015-10-22T15:06:34.736-0400 I NETWORK  [initandlisten] waiting for connections on port 27017
      2015-10-22T15:06:35.476-0400 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:58087 #1 (1 connection now open)
      2015-10-22T15:06:49.926-0400 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:58094 #2 (2 connections now open)
      2015-10-22T15:07:42.991-0400 I -        [conn2] Invariant failure state->currIndex < state->normalizedInserts.size() src/mongo/db/commands/write_commands/batch_executor.cpp 991
      2015-10-22T15:07:42.991-0400 I -        [conn2]
      
      ***aborting after invariant() failure
      
      
      2015-10-22T15:07:42.997-0400 F -        [conn2] Got signal: 6 (Abort trap: 6).
      
       0x10cda66aa 0x10cda5fef 0x7fff926225aa 0x0 0x7fff8ee93b1a 0x10cd4515f 0x10c6a3141 0x10c69effd 0x10c69e7d8 0x10c69d70d 0x10c6a6915 0x10c6c2389 0x10c6c156e 0x10c614762 0x10c7bb607 0x10c7b77ed 0x10c4aa6fc 0x10cd62fd3 0x10cd62791 0x7fff915ec899 0x7fff915ec72a 0x7fff915f0fc9
      ----- BEGIN BACKTRACE -----
      {"backtrace":[{"b":"10C4A0000","o":"9066AA"},{"b":"10C4A0000","o":"905FEF"},{"b":"7FFF9261F000","o":"35AA"},{"b":"0","o":"0"},{"b":"7FFF8EE37000","o":"5CB1A"},{"b":"10C4A0000","o":"8A515F"},{"b":"10C4A0000","o":"203141"},{"b":"10C4A0000","o":"1FEFFD"},{"b":"10C4A0000","o":"1FE7D8"},{"b":"10C4A0000","o":"1FD70D"},{"b":"10C4A0000","o":"206915"},{"b":"10C4A0000","o":"222389"},{"b":"10C4A0000","o":"22156E"},{"b":"10C4A0000","o":"174762"},{"b":"10C4A0000","o":"31B607"},{"b":"10C4A0000","o":"3177ED"},{"b":"10C4A0000","o":"A6FC"},{"b":"10C4A0000","o":"8C2FD3"},{"b":"10C4A0000","o":"8C2791"},{"b":"7FFF915EB000","o":"1899"},{"b":"7FFF915EB000","o":"172A"},{"b":"7FFF915EB000","o":"5FC9"}],"processInfo":{ "mongodbVersion" : "3.2.0-rc1-pre-", "gitVersion" : "737bb20fcb9176eb5f664bd874cdaece779d4012", "compiledModules" : [], "uname" : { "sysname" : "Darwin", "release" : "13.4.0", "version" : "Darwin Kernel Version 13.4.0: Wed Mar 18 16:20:14 PDT 2015; root:xnu-2422.115.14~1/RELEASE_X86_64", "machine" : "x86_64" }, "somap" : [ { "path" : "/Users/annaherlihy/mongo/mongod", "machType" : 2, "b" : "10C4A0000", "buildId" : "1FB13653B90C354F9E379B5564EFA1A9" }, { "path" : "/usr/lib/libSystem.B.dylib", "machType" : 6, "b" : "7FFF91FFC000", "buildId" : "E6BCC0314342318CA1ADA8E9AEAE716F" }, { "path" : "/usr/lib/libc++.1.dylib", "machType" : 6, "b" : "7FFF8815E000", "buildId" : "4F68DFC5207739A8A449CAC5FDEE7BDE" }, { "path" : "/usr/lib/system/libcache.dylib", "machType" : 6, "b" : "7FFF94B53000", "buildId" : "BDC1E65B72A13DA3A57CB23159CAAD0B" }, { "path" : "/usr/lib/system/libcommonCrypto.dylib", "machType" : 6, "b" : "7FFF871CB000", "buildId" : "8C4F0CA0389C3EDCB155E62DD2187E1D" }, { "path" : "/usr/lib/system/libcompiler_rt.dylib", "machType" : 6, "b" : "7FFF8BFDE000", "buildId" : "4CD916B21B17362AB403EF24A1DAC141" }, { "path" : "/usr/lib/system/libcopyfile.dylib", "machType" : 6, "b" : "7FFF8DC15000", "buildId" : "CF29DFF605893590834C82E2316612E8" }, { "path" : "/usr/lib/system/libcorecrypto.dylib", "machType" : 6, "b" : "7FFF88A4B000", "buildId" : "F3973C2814B63006BB2B00DD7F09ABC7" }, { "path" : "/usr/lib/system/libdispatch.dylib", "machType" : 6, "b" : "7FFF9201A000", "buildId" : "C4E4A18D3C3B3C9C8709A4270D998DE7" }, { "path" : "/usr/lib/system/libdyld.dylib", "machType" : 6, "b" : "7FFF8B79E000", "buildId" : "A1273A0249283BACA8466C069DC1A0A6" }, { "path" : "/usr/lib/system/libkeymgr.dylib", "machType" : 6, "b" : "7FFF8765D000", "buildId" : "3AA8D85DCF003BD3A5A0E28E1A32A6D8" }, { "path" : "/usr/lib/system/liblaunch.dylib", "machType" : 6, "b" : "7FFF9091D000", "buildId" : "A40A0C7B321639B48AE0B5D3BAF1DA8A" }, { "path" : "/usr/lib/system/libmacho.dylib", "machType" : 6, "b" : "7FFF8EF95000", "buildId" : "1D2910DFC0363A82A3FD44FF73B5FF9B" }, { "path" : "/usr/lib/system/libquarantine.dylib", "machType" : 6, "b" : "7FFF8B749000", "buildId" : "7A1A2BCBC03D3A25BFA43E569B2D2C38" }, { "path" : "/usr/lib/system/libremovefile.dylib", "machType" : 6, "b" : "7FFF871C9000", "buildId" : "3543F917928E3DB2A2F47AB73B4970EF" }, { "path" : "/usr/lib/system/libsystem_asl.dylib", "machType" : 6, "b" : "7FFF8EB83000", "buildId" : "655FB34352CF3E2FB14DBEBF5AAEF94D" }, { "path" : "/usr/lib/system/libsystem_blocks.dylib", "machType" : 6, "b" : "7FFF905C8000", "buildId" : "FB856CD12AEA39078E9B1E54B6827F82" }, { "path" : "/usr/lib/system/libsystem_c.dylib", "machType" : 6, "b" : "7FFF8EE37000", "buildId" : "6FD3A4004BB23B95B90CBE6E9D0D78FA" }, { "path" : "/usr/lib/system/libsystem_configuration.dylib", "machType" : 6, "b" : "7FFF8E745000", "buildId" : "4998CB6A9D54390A9F575D1AC53C135C" }, { "path" : "/usr/lib/system/libsystem_dnssd.dylib", "machType" : 6, "b" : "7FFF88153000", "buildId" : "17B03FFD92C532829981EBB28B456207" }, { "path" : "/usr/lib/system/libsystem_info.dylib", "machType" : 6, "b" : "7FFF8E79C000", "buildId" : "7D41A156D2853849A2C3C04ADE797D98" }, { "path" : "/usr/lib/system/libsystem_kernel.dylib", "machType" : 6, "b" : "7FFF8F170000", "buildId" : "8116098DB3F13E50A934576DD6369234" }, { "path" : "/usr/lib/system/libsystem_m.dylib", "machType" : 6, "b" : "7FFF8BD05000", "buildId" : "B7F0E2E4277733FCA787D6430B630D54" }, { "path" : "/usr/lib/system/libsystem_malloc.dylib", "machType" : 6, "b" : "7FFF91842000", "buildId" : "A695B4E438E9332EA77229D31E3F1385" }, { "path" : "/usr/lib/system/libsystem_network.dylib", "machType" : 6, "b" : "7FFF898EB000", "buildId" : "0D630D53C7723EC58257EFB0ACCE3153" }, { "path" : "/usr/lib/system/libsystem_notify.dylib", "machType" : 6, "b" : "7FFF88977000", "buildId" : "9B34B4FEF5AD3F09A5F046AFF3571323" }, { "path" : "/usr/lib/system/libsystem_platform.dylib", "machType" : 6, "b" : "7FFF9261F000", "buildId" : "3C3D3DA832B9324398ECD89B9A1670B3" }, { "path" : "/usr/lib/system/libsystem_pthread.dylib", "machType" : 6, "b" : "7FFF915EB000", "buildId" : "AB498556B555310E9041F67EC9E00E2C" }, { "path" : "/usr/lib/system/libsystem_sandbox.dylib", "machType" : 6, "b" : "7FFF8EF43000", "buildId" : "0C93EB2373643670B511212A7A524695" }, { "path" : "/usr/lib/system/libsystem_stats.dylib", "machType" : 6, "b" : "7FFF8AD23000", "buildId" : "337946FCB2E13DFAA8B530DA8D584D75" }, { "path" : "/usr/lib/system/libunc.dylib", "machType" : 6, "b" : "7FFF94B58000", "buildId" : "62682455186236FE8A047A6B91256438" }, { "path" : "/usr/lib/system/libunwind.dylib", "machType" : 6, "b" : "7FFF89F9E000", "buildId" : "78DCC3582FC1302EB3950155B47CB547" }, { "path" : "/usr/lib/system/libxpc.dylib", "machType" : 6, "b" : "7FFF8B9BE000", "buildId" : "AB40CD57F4543FD4B41563B3C0D5C624" }, { "path" : "/usr/lib/libobjc.A.dylib", "machType" : 6, "b" : "7FFF8EF9B000", "buildId" : "AD7FD984271E30F4A3616B20319EC73B" }, { "path" : "/usr/lib/libauto.dylib", "machType" : 6, "b" : "7FFF88773000", "buildId" : "F45C36E8B6063886B5B1B6745E757CA8" }, { "path" : "/usr/lib/libc++abi.dylib", "machType" : 6, "b" : "7FFF8F18D000", "buildId" : "21A807D367323455B77F743E9F916DF0" }, { "path" : "/usr/lib/libDiagnosticMessagesClient.dylib", "machType" : 6, "b" : "7FFF905D7000", "buildId" : "4CDB0F7BC0AF3424BC39495696F0DB1E" } ] }}
       mongod(_ZN5mongo15printStackTraceERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEE+0x3A) [0x10cda66aa]
       mongod(_ZN5mongo12_GLOBAL__N_110abruptQuitEi+0xAF) [0x10cda5fef]
       libsystem_platform.dylib(_sigtramp+0x1A) [0x7fff926225aa]
       ??? [0x0]
       libsystem_c.dylib(abort+0x7D) [0x7fff8ee93b1a]
       mongod(_ZN5mongo15invariantFailedEPKcS1_j+0x31F) [0x10cd4515f]
       mongod(_ZN5mongo18WriteBatchExecutor10insertManyEPNS0_16ExecInsertsStateEmmPNS_5CurOpEPNSt3__16vectorIPNS_16WriteErrorDetailENS5_9allocatorIS8_EEEEb+0x15B1) [0x10c6a3141]
       mongod(_ZN5mongo18WriteBatchExecutor11execInsertsERKNS_21BatchedCommandRequestEPNSt3__16vectorIPNS_16WriteErrorDetailENS4_9allocatorIS7_EEEE+0x40D) [0x10c69effd]
       mongod(_ZN5mongo18WriteBatchExecutor11bulkExecuteERKNS_21BatchedCommandRequestEPNSt3__16vectorIPNS_19BatchedUpsertDetailENS4_9allocatorIS7_EEEEPNS5_IPNS_16WriteErrorDetailENS8_ISD_EEEE+0x238) [0x10c69e7d8]
       mongod(_ZN5mongo18WriteBatchExecutor12executeBatchERKNS_21BatchedCommandRequestEPNS_22BatchedCommandResponseE+0x34D) [0x10c69d70d]
       mongod(_ZN5mongo8WriteCmd3runEPNS_16OperationContextERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERNS_7BSONObjEiRS9_RNS_14BSONObjBuilderE+0x1E5) [0x10c6a6915]
       mongod(_ZN5mongo7Command3runEPNS_16OperationContextERKNS_3rpc16RequestInterfaceEPNS3_21ReplyBuilderInterfaceE+0x989) [0x10c6c2389]
       mongod(_ZN5mongo7Command11execCommandEPNS_16OperationContextEPS0_RKNS_3rpc16RequestInterfaceEPNS4_21ReplyBuilderInterfaceE+0xB5E) [0x10c6c156e]
       mongod(_ZN5mongo11runCommandsEPNS_16OperationContextERKNS_3rpc16RequestInterfaceEPNS2_21ReplyBuilderInterfaceE+0x2A2) [0x10c614762]
       mongod(_ZN5mongoL15receivedCommandEPNS_16OperationContextERKNS_15NamespaceStringERNS_6ClientERNS_10DbResponseERNS_7MessageE+0x107) [0x10c7bb607]
       mongod(_ZN5mongo16assembleResponseEPNS_16OperationContextERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x83D) [0x10c7b77ed]
       mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortE+0xBC) [0x10c4aa6fc]
       mongod(_ZN5mongo17PortMessageServer17handleIncomingMsgEPv+0x253) [0x10cd62fd3]
       mongod(_ZNSt3__114__thread_proxyINS_5tupleIJNS_6__bindIPFPvS3_EJPN5mongo12_GLOBAL__N_124MessagingPortWithHandlerEEEEEEEEES3_S3_+0x61) [0x10cd62791]
       libsystem_pthread.dylib(_pthread_body+0x8A) [0x7fff915ec899]
       libsystem_pthread.dylib(_pthread_struct_init+0x0) [0x7fff915ec72a]
       libsystem_pthread.dylib(thread_start+0xD) [0x7fff915f0fc9]
      -----  END BACKTRACE  -----
      Abort trap: 6
      

            Assignee:
            martin.bligh Martin Bligh
            Reporter:
            anna.herlihy@mongodb.com Anna Herlihy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: