[Lldb-commits] [lldb] r232724 - Don't close pseudo terminal master file descriptor on EOF

Tamas Berghammer tberghammer at google.com
Thu Mar 19 07:58:37 PDT 2015


Author: tberghammer
Date: Thu Mar 19 09:58:36 2015
New Revision: 232724

URL: http://llvm.org/viewvc/llvm-project?rev=232724&view=rev
Log:
Don't close pseudo terminal master file descriptor on EOF

Some application on Linux an all application on android close stdout and
stderr during the libc exit stage. Previously the master file descriptor
of the pseudo terminal used to communicate with the inferior was closed
on an EOF causing a race condition and a possible SIGHUP on process
exit. After this change the master file descriptor will be closed by the
destructor of the GDBRemoteCommunicationServerLLGS class.

Differential revision: http://reviews.llvm.org/D8436

Modified:
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp?rev=232724&r1=232723&r2=232724&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp Thu Mar 19 09:58:36 2015
@@ -806,6 +806,7 @@ GDBRemoteCommunicationServerLLGS::SetSTD
         return error;
     }
 
+    m_stdio_communication.SetCloseOnEOF (false);
     m_stdio_communication.SetConnection (conn_up.release());
     if (!m_stdio_communication.IsConnected ())
     {





More information about the lldb-commits mailing list