Fix deadlock in gdb-client tests
authorPavel Labath <pavel@labath.sk>
Thu, 30 Aug 2018 19:14:02 +0000 (19:14 +0000)
committerPavel Labath <pavel@labath.sk>
Thu, 30 Aug 2018 19:14:02 +0000 (19:14 +0000)
Using a listen queue of length 0 caused a deadlock on my machine in the
gdb-client tests while attempting to establish the loopback socket
connection.

I am not sure if this is down to a different python or kernel version,
but in either case, having queue of length zero sounds like a bad idea,
so I'm bumping that to one (which also fixes the deadlock).

llvm-svn: 341096

lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py

index d8d759a..b86a0c6 100644 (file)
@@ -246,7 +246,7 @@ class MockGDBServer:
         addr = ("127.0.0.1", self.port)
         self._socket.bind(addr)
         self.port = self._socket.getsockname()[1]
-        self._socket.listen(0)
+        self._socket.listen(1)
         self._thread = threading.Thread(target=self._run)
         self._thread.start()