apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: FW: svn_io_run_cmd running out of file handles, APR bug?
Date Mon, 21 Jan 2002 12:30:10 GMT
"Sander Striker" <striker@apache.org> writes:

> Hi,
> Anyone a direct idea of what is going on and if it is
> correct or not?

of course it isn't correct :)

another example: mod_cgid

mod_cgid currently has a pipe leak.

mod_cgid for a long time has had some needless opening/closing of

Run strace on mod_cgid and you'll see several "close(-1)" calls for
each request.  There is some discrepancy between cleanups and explicit
close logic for some reason.

I don't see any leak in mod_cgi.

No, I don't know what is going on.  I have a feeling that part of this
is due to a broken API (APR doesn't have the information it needs to
know when to create pipes).  The leak is just a bug, perhaps
introduced with recent changes to apr_file_dup[2].

> -----Original Message-----
> From: Philip Martin [mailto:philip@codematters.co.uk]
> Sent: 13 January 2002 05:26
> To: dev@subversion.tigris.org
> Subject: svn_io_run_cmd running out of file handles, APR bug?
> Hi
> Writing a new test I have been calling svn_io_run_cmd() in a loop,
> after a few hundred calls it fails with
> apr_error: #24, src_err 0 : <Too many open files>
>   run_cmd_in_directory: error setting /usr/bin/cmp process io attributes
> Looking in /proc/nnn/fd I see hundreds of pipes.
> As far as I can see:
> - svn_io_run_cmd() calls apr_procattr_io_set()
>   This calls apr_file_pipe_create() to creates three pipes in the
>   apr_procattr_t structure.
> - svn_io_run_cmd() calls apr_procattr_child_in_set(),
>   apr_procattr_child_out_set() and apr_procattr_child_err_set()
>   These call apr_file_dup() and overwrite the pipe descriptors.
> The result is that the pipe descriptors don't get closed and so
> accumulate until the process runs out of resources.
> Now even if svn_io_run_cmd() doesn't call apr_procattr_io_set() to
> create the pipes, the problem will still occur because the three
> functions apr_procattr_child_err_set() et.al. each start by calling
> apr_file_pipe_create() themselves if the pipe doesn't exist.
> What are these pipes for? It seems silly to create them simply to
> close them again. Is this an APR bug?
> -- 
> Philip
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
             Born in Roswell... married an alien...

View raw message