cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: cURL processes hanging when run via a system call

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 27 Feb 2006 10:33:37 -0800

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