This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch gdbserver 7.6.1 only] Fix fd leak regression


On 08/29/2013 06:22 PM, Tom Tromey wrote:
> Tom> Yeah, I meant the other filestuff.h code, like gdb_socket_cloexec and
> Tom> gdb_pipe_cloexec.
> 

>     second, the in process agent can't use gdb_socket_cloexec 

But, why ?

> @@ -596,7 +596,7 @@ linux_create_inferior (char *program, char **allargs)
>        if (remote_connection_is_stdio ())
>  	{
>  	  close (0);
> -	  open ("/dev/null", O_RDONLY);
> +	  gdb_open_cloexec ("/dev/null", O_RDONLY, 0);

This is the child opening its stdin.  Doesn't look
correct to close it on the subsequent exec.

>  
>  #include <ctype.h>
>  #include <fcntl.h>
> @@ -147,6 +148,9 @@ trace_vdebug (const char *fmt, ...)
>  # define ust_loaded gdb_agent_ust_loaded
>  # define helper_thread_id gdb_agent_helper_thread_id
>  # define cmd_buf gdb_agent_cmd_buf
> +
> +/* We don't want to use this one in IPA.  */

"because ..." ?

> +# define gdb_socket_cloexec socket
>  #endif

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]