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

leak in PortMessageServer::acceptMP

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.8.0-rc5
    • Affects Version/s: 2.8.0-rc4
    • Component/s: Networking
    • None
    • Fully Compatible
    • ALL

      When running the jsCore test suite with the clang Leak Sanitizer enabled, the following leak has been observed occasionally whenever buildscripts/smoke.py restarts the mongod server:

      2014-12-30T18:56:33.961+0000 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:35664 #4 (1 connection now open)
      2014-12-30T18:56:33.961+0000 I CONTROL  [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
      2014-12-30T18:56:33.961+0000 I COMMAND  [signalProcessingThread] now exiting
      2014-12-30T18:56:33.961+0000 I NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
      2014-12-30T18:56:33.961+0000 I NETWORK  [signalProcessingThread] closing listening socket: 7
      2014-12-30T18:56:33.961+0000 I NETWORK  [signalProcessingThread] closing listening socket: 8
      2014-12-30T18:56:33.961+0000 I NETWORK  [signalProcessingThread] closing listening socket: 12
      2014-12-30T18:56:33.961+0000 I NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27999.sock
      2014-12-30T18:56:33.961+0000 I NETWORK  [signalProcessingThread] shutdown: going to flush diaglog...
      2014-12-30T18:56:33.962+0000 I NETWORK  [signalProcessingThread] shutdown: going to close sockets...
      2014-12-30T18:56:33.962+0000 I STORAGE  [signalProcessingThread] shutdown: waiting for fs preallocator...
      2014-12-30T18:56:33.962+0000 I STORAGE  [signalProcessingThread] shutdown: final commit...
      2014-12-30T18:56:33.962+0000 I STORAGE  [signalProcessingThread] shutdown: closing all files...
      2014-12-30T18:56:33.962+0000 I STORAGE  [signalProcessingThread] closeAllFiles() finished
      2014-12-30T18:56:33.962+0000 I JOURNAL  [signalProcessingThread] journalCleanup...
      2014-12-30T18:56:33.962+0000 I JOURNAL  [signalProcessingThread] removeJournalFiles
      2014-12-30T18:56:33.962+0000 I STORAGE  [signalProcessingThread] shutdown: removing fs lock...
      2014-12-30T18:56:33.962+0000 I COMMAND  [signalProcessingThread] dbexit:  rc: 0
      2014-12-30T18:56:33.987+0000 I NETWORK  [initandlisten] Port 27999 is no longer valid
      =================================================================
      ==3347==ERROR: LeakSanitizer: detected memory leaks
      Direct leak of 16 byte(s) in 1 object(s) allocated from:
          #0 0x92cac9 in operator new(unsigned long) (/data/mci/shell/src/mongod+0x92cac9)
          #1 0x24f5184 in mongo::PortMessageServer::acceptedMP(mongo::MessagingPort*) /data/mci/shell/src/src/mongo/util/net/message_server_port.cpp:117
          #2 0x24e888b in mongo::Listener::accepted(boost::shared_ptr<mongo::Socket>, long long) /data/mci/shell/src/src/mongo/util/net/listen.cpp:575
          #3 0x24e62b4 in mongo::Listener::initAndListen() /data/mci/shell/src/src/mongo/util/net/listen.cpp:339
          #4 0x94d784 in mongo::_initAndListen(int) /data/mci/shell/src/src/mongo/db/db.cpp:619
          #5 0x94272b in mongo::initAndListen(int) /data/mci/shell/src/src/mongo/db/db.cpp:624
          #6 0x958fac in mongoDbMain(int, char**, char**) /data/mci/shell/src/src/mongo/db/db.cpp:870
          #7 0x958fac in main /data/mci/shell/src/src/mongo/db/db.cpp:673
          #8 0x7f5fdee9dec4 (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
      -----------------------------------------------------
      Suppressions used:
        count      bytes template
            7       8688 mongo::Client::Client
      -----------------------------------------------------
      SUMMARY: AddressSanitizer: 16 byte(s) leaked in 1 allocation(s).
      

      Here's the line with the leak:

      https://github.com/mongodb/mongo/blob/af8fdf9102f60fc731ef64c8ad5cb2b19745dc4e/src/mongo/util/net/message_server_port.cpp#L117

                      HandleIncomingMsgParam* himParam = new HandleIncomingMsgParam(p, _handler);
      

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            benety.goh@mongodb.com Benety Goh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: