cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: cURL processes hanging when run via a system call

From: Lars Nilsson <chamaeleon_at_gmail.com>
Date: Mon, 27 Feb 2006 13:43:11 -0500

If the tool is available on the machine in question, perhaps lsof
(list open files) will give an indication as to what files or paths
are currently open by the process when the error condition occurs..
This could help narrow down the problem, perhaps.

Lars Nilsson

On 2/27/06, Dan Fandrich <dan_at_coneharvesters.com> wrote:
> On Mon, Feb 27, 2006 at 12:46:05PM -0500, Chris Tata wrote:
> > cURL has hung again. here is the strace:
> >
> > pipe([4294967295, 4294967295]) = -1 EMFILE (Too many open files)
> > pipe([4294967295, 4294967295]) = -1 EMFILE (Too many open files)
> > pipe([4294967295, 4294967295]) = -1 EMFILE (Too many open files)
> > pipe([4294967295, 4294967295]) = -1 EMFILE (Too many open files)
> > pipe([4294967295, 4294967295]) = -1 EMFILE (Too many open files)
> > pipe([4294967295, 4294967295]) = -1 EMFILE (Too many open files)
> > pipe([4294967295, 4294967295]) = -1 EMFILE (Too many open files)
> > pipe([4294967295, 4294967295]) = -1 EMFILE (Too many open files)
> > pipe([4294967295, 4294967295]) = -1 EMFILE (Too many open files)
>
> The only relevant pipe() call in curl is in checkfds(), which does look like
> it could cause these symptoms under those conditions. Try this patch:
>
> Index: main.c
> ===================================================================
> RCS file: /cvsroot/curl/curl/src/main.c,v
> retrieving revision 1.350
> diff -u -r1.350 main.c
> --- main.c 21 Feb 2006 15:25:22 -0000 1.350
> +++ main.c 27 Feb 2006 18:32:56 -0000
> @@ -4291,7 +4291,8 @@
> fd[1] == STDIN_FILENO ||
> fd[1] == STDOUT_FILENO ||
> fd[1] == STDERR_FILENO )
> - pipe(fd);
> + if (pipe(fd) < 0)
> + break;
>
> close(fd[0]);
> close(fd[1]);
>
> --
> http://www.MoveAnnouncer.com The web change of address service
> Let webmasters know that your web site has moved
>
Received on 2006-02-27