[Lldb-commits] [lldb] r233651 - Fix socket leak in lldb-server platform

Vince Harron vince at nethacker.com
Mon Mar 30 17:24:51 PDT 2015


Author: vharron
Date: Mon Mar 30 19:24:51 2015
New Revision: 233651

URL: http://llvm.org/viewvc/llvm-project?rev=233651&view=rev
Log:
Fix socket leak in lldb-server platform

lldb-server server process was holding on to a connection to every
client that connected. This continued until the process hit it's
file limit and exited.

lldb-server p --listen *:5432 --server

run remote tests against that server more than 1000 times

Differential Revision: http://reviews.llvm.org/D8697


Modified:
    lldb/trunk/tools/lldb-server/lldb-platform.cpp

Modified: lldb/trunk/tools/lldb-server/lldb-platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-platform.cpp?rev=233651&r1=233650&r2=233651&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-server/lldb-platform.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-platform.cpp Mon Mar 30 19:24:51 2015
@@ -287,6 +287,10 @@ main_platform (int argc, char *argv[])
             while (waitpid(-1, nullptr, WNOHANG) > 0);
             if (fork())
             {
+                // Parent doesn't need a connection to the lldb client
+                delete socket;
+                socket = nullptr;
+
                 // Parent will continue to listen for new connections.
                 continue;
             }





More information about the lldb-commits mailing list