apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: mod_cgid pipe leak
Date Thu, 24 Jan 2002 12:44:00 GMT
Jeff Trawick <trawick@attglobal.net> writes:

> I'll try to follow up with an strace of the cgid daemon across a
> CGI...  gotta rebuild (I always seem to have the wrong config for
> what I want to do next...  maybe some cron jobs need to keep a couple
> of build flavors current :) )

This is current HEAD on Linux (with some apr_pools.c code ifdef-ed
out so it woud compile... whats up with that?).

accept(6, {sin_family=AF_UNIX, path=@
0000020fwick/apacheinst/logs/cgisock}, [11]) = 7
read(7, "\1\0\0\0", 4)                  = 4
read(7, "\22\0\0\0", 4)                 = 4
read(7, "\23\3\0\0", 4)                 = 4
read(7, "/home/trawick/apacheinst/cgi-bin"..., 787) = 787
read(7, "\0\0\0\0", 4)                  = 4
pipe([10, 12])                          = 0
fcntl(12, F_GETFL)                      = 0x1 (flags O_WRONLY)
fcntl(12, F_SETFL, O_WRONLY|O_NONBLOCK) = 0
pipe([15, 17])                          = 0
fcntl(15, F_GETFL)                      = 0 (flags O_RDONLY)
fcntl(15, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
pipe([18, 19])                          = 0
fcntl(18, F_GETFL)                      = 0 (flags O_RDONLY)
fcntl(18, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
dup(2)                                  = 20
dup(7)                                  = 21
dup(7)                                  = 22
close(7)                                = 0
fork()                                  = 14788
close(21)                               = 0
close(22)                               = 0
close(20)                               = 0
close(-1)                               = -1 EBADF (Bad file
descriptor)
close(18)                               = 0
close(-1)                               = -1 EBADF (Bad file
descriptor)
close(15)                               = 0
close(12)                               = 0
close(-1)                               = -1 EBADF (Bad file
descriptor)
accept(6, 0xbffff968, [110])            = ? ERESTARTSYS (To be
restarted)
--- SIGCHLD (Child exited) ---
accept(6,

After running a 3 CGI requests through, lsof shows this:

lt-httpd 14710 trawick    0r   CHR        1,3           4101 /dev/null
lt-httpd 14710 trawick    1w   CHR        1,3           4101 /dev/null
lt-httpd 14710 trawick    2u   REG        3,5   62818   2050
/home/trawick/apacheinst/logs/error_log
lt-httpd 14710 trawick    3u  IPv4     824589            TCP *:9999
(LISTEN)
lt-httpd 14710 trawick    4u  IPv4     824590            TCP *:tproxy
(LISTEN)
lt-httpd 14710 trawick    5u   REG        3,5   62818   2050
/home/trawick/apacheinst/logs/error_log
lt-httpd 14710 trawick    6u  unix 0xc06ef240         824604
/home/trawick/apacheinst/logs/cgisock
lt-httpd 14710 trawick    8r  FIFO        0,0         824620 pipe
lt-httpd 14710 trawick    9r  FIFO        0,0         824633 pipe
lt-httpd 14710 trawick   10r  FIFO        0,0         824641 pipe
lt-httpd 14710 trawick   11w  FIFO        0,0         824621 pipe
lt-httpd 14710 trawick   13w  FIFO        0,0         824622 pipe
lt-httpd 14710 trawick   14w  FIFO        0,0         824634 pipe
lt-httpd 14710 trawick   16w  FIFO        0,0         824635 pipe
lt-httpd 14710 trawick   17w  FIFO        0,0         824642 pipe
lt-httpd 14710 trawick   19w  FIFO        0,0         824643 pipe

So we lose 3 pipe descriptors per request.
-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Mime
View raw message