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

do not touch sync source connection outside of bgsync thread

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0-rc3
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • ALL

      In the crash seen below, it is likely that stop() was called while the bgsync thread was in a call to recv(). stop() in another thread deletes the DBClientConnection object out from underneath the bgsync thread.

      2014-12-09T18:20:01.231-0500 I REPL     [rsSync] initial sync pending
      2014-12-09T18:20:01.232-0500 D REPL     [SyncSourceFeedback] resetting connection in sync source feedback
      2014-12-09T18:20:01.233-0500 I NETWORK  [rsBackgroundSync] Socket recv() errno:9 Bad file descriptor 10.4.114.213:27027
      2014-12-09T18:20:01.233-0500 I REPL     [ReplicationExecutor] syncing from: Asyas-MacBook-Pro.local:27027
      2014-12-09T18:20:01.234-0500 F -        [rsBackgroundSync] Invalid access at address: 0x20
      2014-12-09T18:20:01.235-0500 I REPL     [rsSync] initial sync drop all databases
      2014-12-09T18:20:01.235-0500 I STORAGE  [rsSync] dropAllDatabasesExceptLocal 3
      2014-12-09T18:20:01.240-0500 F -        [rsBackgroundSync] Got signal: 11 (Segmentation fault: 11).
      
       0x10dfc9839 0x10dfc93fe 0x7fff904a15aa 0x10f363a00 0x10df8b662 0x10d8ed8c6 0x10d9016c5 0x10d901f1f 0x10dcb5656 0x10dcb4a77 0x10dcb4658 0x10dffd551 0x7fff90bfc899 0x7fff90bfc72a 0x7fff90c00fc9
      ----- BEGIN BACKTRACE -----
      {"backtrace":[{"b":"10D89A000","o":"72F839"},{"b":"10D89A000","o":"72F3FE"},{"b":"7FFF9049E000","o":"35AA"},{"b":"0","o":"10F363A00"},{"b":"10D89A000","o":"6F1662"},{"b":"10D89A000","o":"538C6"},{"b":"10D89A000","o":"676C5"},{"b":"10D89A000","o":"67F1F"},{"b":"10D89A000","o":"41B656"},{"b":"10D89A000","o":"41AA77"},{"b":"10D89A000","o":"41A658"},{"b":"10D89A000","o":"763551"},{"b":"7FFF90BFB000","o":"1899"},{"b":"7FFF90BFB000","o":"172A"},{"b":"7FFF90BFB000","o":"5FC9"}],"processInfo":{ "mongodbVersion" : "2.8.0-rc2", "gitVersion" : "f77869e01a6ed235695a46fad441c0dff15202f6", "uname" : { "sysname" : "Darwin", "release" : "13.4.0", "version" : "Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64", "machine" : "x86_64" }, "somap" : [ { "path" : "/Users/asya/mongodb/bin/mongod", "machType" : 2, "b" : "10D89A000", "buildId" : "5E5E1684499B308383920314F3A9D5EA" }, { "path" : "/usr/lib/libSystem.B.dylib", "machType" : 6, "b" : "7FFF8AE07000", "buildId" : "E303F2F8A8CF3DF384B3F2D0EE41CCF6" }, { "path" : "/usr/lib/libc++.1.dylib", "machType" : 6, "b" : "7FFF91A2E000", "buildId" : "2CB96D101E3E39B1B90DC56C3818321E" }, { "path" : "/usr/lib/system/libcache.dylib", "machType" : 6, "b" : "7FFF9504F000", "buildId" : "8C1EFC4F3F513DE9A973360B461F3D65" }, { "path" : "/usr/lib/system/libcommonCrypto.dylib", "machType" : 6, "b" : "7FFF8AD65000", "buildId" : "79B8E80FE59633028243EC479B9546CA" }, { "path" : "/usr/lib/system/libcompiler_rt.dylib", "machType" : 6, "b" : "7FFF8AB04000", "buildId" : "2A8900040A783E339AC5A7D63BD4F879" }, { "path" : "/usr/lib/system/libcopyfile.dylib", "machType" : 6, "b" : "7FFF8CEB4000", "buildId" : "CF29DFF605893590834C82E2316612E8" }, { "path" : "/usr/lib/system/libcorecrypto.dylib", "machType" : 6, "b" : "7FFF8AD98000", "buildId" : "F3973C2814B63006BB2B00DD7F09ABC7" }, { "path" : "/usr/lib/system/libdispatch.dylib", "machType" : 6, "b" : "7FFF9797A000", "buildId" : "C4E4A18D3C3B3C9C8709A4270D998DE7" }, { "path" : "/usr/lib/system/libdyld.dylib", "machType" : 6, "b" : "7FFF8AD70000", "buildId" : "7C9EC3B7DDE333FF953F4067C743951D" }, { "path" : "/usr/lib/system/libkeymgr.dylib", "machType" : 6, "b" : "7FFF8CBC6000", "buildId" : "D7045F25BFA43840847DAF95DF8B6CCA" }, { "path" : "/usr/lib/system/liblaunch.dylib", "machType" : 6, "b" : "7FFF915E4000", "buildId" : "A40A0C7B321639B48AE0B5D3BAF1DA8A" }, { "path" : "/usr/lib/system/libmacho.dylib", "machType" : 6, "b" : "7FFF8F448000", "buildId" : "B2BE3C25CF1F309BAB991F0B54621445" }, { "path" : "/usr/lib/system/libquarantine.dylib", "machType" : 6, "b" : "7FFF8AB01000", "buildId" : "973BE51D6465392F9099D4AB21BF0D25" }, { "path" : "/usr/lib/system/libremovefile.dylib", "machType" : 6, "b" : "7FFF8EF41000", "buildId" : "26266E3FFDDC3CFCB27F78B49BDC9BDC" }, { "path" : "/usr/lib/system/libsystem_asl.dylib", "machType" : 6, "b" : "7FFF92C44000", "buildId" : "B983CA60F418317BB14248A6376564FC" }, { "path" : "/usr/lib/system/libsystem_blocks.dylib", "machType" : 6, "b" : "7FFF8FFA5000", "buildId" : "FB856CD12AEA39078E9B1E54B6827F82" }, { "path" : "/usr/lib/system/libsystem_c.dylib", "machType" : 6, "b" : "7FFF8CD37000", "buildId" : "6FD3A4004BB23B95B90CBE6E9D0D78FA" }, { "path" : "/usr/lib/system/libsystem_configuration.dylib", "machType" : 6, "b" : "7FFF8AD62000", "buildId" : "4998CB6A9D54390A9F575D1AC53C135C" }, { "path" : "/usr/lib/system/libsystem_dnssd.dylib", "machType" : 6, "b" : "7FFF96671000", "buildId" : "17B03FFD92C532829981EBB28B456207" }, { "path" : "/usr/lib/system/libsystem_info.dylib", "machType" : 6, "b" : "7FFF90CB3000", "buildId" : "395D8CD6616A3BD3A195C6D68EB9AB22" }, { "path" : "/usr/lib/system/libsystem_kernel.dylib", "machType" : 6, "b" : "7FFF8BE35000", "buildId" : "9EDE872E2A9E3A788E1DAB790794A098" }, { "path" : "/usr/lib/system/libsystem_m.dylib", "machType" : 6, "b" : "7FFF8EBC7000", "buildId" : "9D96AACD58703A5CB8497F9C0F6EBB09" }, { "path" : "/usr/lib/system/libsystem_malloc.dylib", "machType" : 6, "b" : "7FFF8CDDD000", "buildId" : "A695B4E438E9332EA77229D31E3F1385" }, { "path" : "/usr/lib/system/libsystem_network.dylib", "machType" : 6, "b" : "7FFF95A24000", "buildId" : "A499D688916537768C8EC018897B5B13" }, { "path" : "/usr/lib/system/libsystem_notify.dylib", "machType" : 6, "b" : "7FFF91EEA000", "buildId" : "9B34B4FEF5AD3F09A5F046AFF3571323" }, { "path" : "/usr/lib/system/libsystem_platform.dylib", "machType" : 6, "b" : "7FFF9049E000", "buildId" : "3C3D3DA832B9324398ECD89B9A1670B3" }, { "path" : "/usr/lib/system/libsystem_pthread.dylib", "machType" : 6, "b" : "7FFF90BFB000", "buildId" : "9DA50FD0D9AC3051AD4BBA0D745BC49C" }, { "path" : "/usr/lib/system/libsystem_sandbox.dylib", "machType" : 6, "b" : "7FFF95F7F000", "buildId" : "0D0B13EA6B7A3AC8BE60B548543BEB77" }, { "path" : "/usr/lib/system/libsystem_stats.dylib", "machType" : 6, "b" : "7FFF8A7B5000", "buildId" : "4E51D5B092A03D0DB90E495A1ED3E391" }, { "path" : "/usr/lib/system/libunc.dylib", "machType" : 6, "b" : "7FFF924F9000", "buildId" : "C3737C9AC06F310CB78C7D8D882A35DE" }, { "path" : "/usr/lib/system/libunwind.dylib", "machType" : 6, "b" : "7FFF8DEFF000", "buildId" : "95D4D11833683474989D271DE18C8365" }, { "path" : "/usr/lib/system/libxpc.dylib", "machType" : 6, "b" : "7FFF8FF12000", "buildId" : "AB40CD57F4543FD4B41563B3C0D5C624" }, { "path" : "/usr/lib/libobjc.A.dylib", "machType" : 6, "b" : "7FFF90D91000", "buildId" : "F21C57427B9C31F1BBAE1717BC6C2F1B" }, { "path" : "/usr/lib/libauto.dylib", "machType" : 6, "b" : "7FFF90C63000", "buildId" : "F45C36E8B6063886B5B1B6745E757CA8" }, { "path" : "/usr/lib/libc++abi.dylib", "machType" : 6, "b" : "7FFF91A92000", "buildId" : "21A807D367323455B77F743E9F916DF0" }, { "path" : "/usr/lib/libDiagnosticMessagesClient.dylib", "machType" : 6, "b" : "7FFF8E773000", "buildId" : "4CDB0F7BC0AF3424BC39495696F0DB1E" } ] }}
       mongod(_ZN5mongo15printStackTraceERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEE+0x39) [0x10dfc9839]
       mongod(_ZN5mongo12_GLOBAL__N_124abruptQuitWithAddrSignalEiP9__siginfoPv+0x11E) [0x10dfc93fe]
       libsystem_platform.dylib(_sigtramp+0x1A) [0x7fff904a15aa]
       ??? [0x10f363a00]
       mongod(_ZN5mongo13MessagingPort4recvERKNS_7MessageERS1_+0x22) [0x10df8b662]
       mongod(_ZN5mongo18DBClientConnection4callERNS_7MessageES2_bPNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE+0x46) [0x10d8ed8c6]
       mongod(_ZN5mongo14DBClientCursor11requestMoreEv+0x265) [0x10d9016c5]
       mongod(_ZN5mongo14DBClientCursor4moreEv+0x3F) [0x10d901f1f]
       mongod(_ZN5mongo4repl14BackgroundSync7produceEPNS_16OperationContextE+0x716) [0x10dcb5656]
       mongod(_ZN5mongo4repl14BackgroundSync15_producerThreadEv+0x97) [0x10dcb4a77]
       mongod(_ZN5mongo4repl14BackgroundSync14producerThreadEv+0x78) [0x10dcb4658]
       mongod(_ZN5boost12_GLOBAL__N_112thread_proxyEPv+0xB1) [0x10dffd551]
       libsystem_pthread.dylib(_pthread_body+0x8A) [0x7fff90bfc899]
       libsystem_pthread.dylib(_pthread_struct_init+0x0) [0x7fff90bfc72a]
       libsystem_pthread.dylib(thread_start+0xD) [0x7fff90c00fc9]
      -----  END BACKTRACE  -----
      

            Assignee:
            milkie@mongodb.com Eric Milkie
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: