You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2003/02/19 16:46:30 UTC

DO NOT REPLY [Bug 17206] New: - Filehandles of logs not closed before exec of cgi scripts

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17206>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17206

Filehandles of logs not closed before exec of cgi scripts

           Summary: Filehandles of logs not closed before exec of cgi
                    scripts
           Product: Apache httpd-2.0
           Version: 2.0.44
          Platform: All
        OS/Version: FreeBSD
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: ck@cksoft.de


We updated one of our servers from apache-2.0.39 to 
apache-2.0.44 and noticed that 2.0.44 fails to close 
the file handles of the logfiles before executing cgi 
scripts.

We test by running a php script via the cgi interface and 
using lsof to list the open file handles. (See below)

This enables cgi's to access the logs of other virtual hosts.

We can reproduce this under FreeBSD 4-STBALE and 5.0 RELEASE
using the preforked mpm and apache-2.0.40, 2.0.43 and 2.0.44.
The problem does not occur on apache-2.0.39.  

We think this bug might be related to Bug 12774 which was closed
due to lack of response from the original poster.  This was also 
oing from 2.0.39 to 2.0.40.

This could also be related to the changes in apr/file_io/src/unix/file_dup.c
from 1.48 to 1.49 and the introduction of apr_file_setaside().   
These changes were after 2.0.39 and before 2.0.40.

Greetings
Christian Kratzer
CK Software GmbH

--snipp--
COMMAND  PID    USER   FD   TYPE     DEVICE SIZE/OFF    NODE NAME
php     3308 webmail  cwd   VDIR 151,131079      512 1474242
/u1/jails/jail-webmail/www/servers/webmail/htdocs
php     3308 webmail  rtd   VDIR 151,131079      512 1291924 /u1/jails/jail-webmail
php     3308 webmail  txt   VREG 151,131079  1343042 1473554
/u1/jails/jail-webmail/www/cgi-php/php
php     3308 webmail  txt   VREG 151,131079    80080 1293805
/u1/jails/jail-webmail/usr/libexec/ld-elf.so.1
php     3308 webmail  txt   VREG 151,131079   749398 1473486
/u1/jails/jail-webmail/usr/local/lib/libc-client4.so.8
php     3308 webmail  txt   VREG 151,131079   126427 1452224
/u1/jails/jail-webmail/usr/local/lib/libexpat.so.4
php     3308 webmail  txt   VREG 151,131079    19544 1292898
/u1/jails/jail-webmail/usr/lib/libhistory.so.4
php     3308 webmail  txt   VREG 151,131079   147000 1292903
/u1/jails/jail-webmail/usr/lib/libreadline.so.4
php     3308 webmail  txt   VREG 151,131079   258872 1292446
/u1/jails/jail-webmail/usr/lib/libncurses.so.5
php     3308 webmail  txt   VREG 151,131079    85712 1473115
/u1/jails/jail-webmail/usr/local/lib/libpq.so.3
php     3308 webmail  txt   VREG 151,131079   132379 1473270
/u1/jails/jail-webmail/usr/local/lib/mysql/libmysqlclient.so.10
php     3308 webmail  txt   VREG 151,131079    51156 1292749
/u1/jails/jail-webmail/usr/lib/libz.so.2
php     3308 webmail  txt   VREG 151,131079    28480 1292428
/u1/jails/jail-webmail/usr/lib/libcrypt.so.2
php     3308 webmail  txt   VREG 151,131079   192724 1452773
/u1/jails/jail-webmail/usr/local/lib/libldap.so.2
php     3308 webmail  txt   VREG 151,131079    47937 1452770
/u1/jails/jail-webmail/usr/local/lib/liblber.so.2
php     3308 webmail  txt   VREG 151,131079    38500 1292702
/u1/jails/jail-webmail/usr/lib/libpam.so.1
php     3308 webmail  txt   VREG 151,131079   908698 1473181
/u1/jails/jail-webmail/usr/local/lib/libiconv.so.3
php     3308 webmail  txt   VREG 151,131079   211156 1473420
/u1/jails/jail-webmail/usr/local/lib/libgd.so.4
php     3308 webmail  txt   VREG 151,131079   340310 1473287
/u1/jails/jail-webmail/usr/local/lib/libfreetype.so.9
php     3308 webmail  txt   VREG 151,131079   139364 1472995
/u1/jails/jail-webmail/usr/local/lib/libpng.so.5
php     3308 webmail  txt   VREG 151,131079   135696 1473155
/u1/jails/jail-webmail/usr/local/lib/libjpeg.so.9
php     3308 webmail  txt   VREG 151,131079   117736 1292433
/u1/jails/jail-webmail/usr/lib/libm.so.2
php     3308 webmail  txt   VREG 151,131079   762896 1293883
/u1/jails/jail-webmail/usr/lib/libcrypto.so.2
php     3308 webmail  txt   VREG 151,131079   181720 1293903
/u1/jails/jail-webmail/usr/lib/libssl.so.2
php     3308 webmail  txt   VREG 151,131079   575584 1292596
/u1/jails/jail-webmail/usr/lib/libc.so.4
php     3308 webmail    0u  PIPE 0xf08bb4e0    16384
php     3308 webmail    1u  PIPE 0xeba05bc0    16384         ->0xf08bb760
php     3308 webmail    2u  PIPE 0xebcb63a0    16384         ->0xeba03960
php     3308 webmail    4u  PIPE 0xeba03a00    16384         ->0xeb666a00
php     3308 webmail    5u  PIPE 0xeb666a00    16384         ->0xeba03a00
php     3308 webmail    6u  VREG 151,131079     4519 1474234
/u1/jails/jail-webmail/www/logs/httpd-error.log
php     3308 webmail    7u  VREG 151,131079        0 1474628
/u1/jails/jail-webmail/www/servers/webmail109/logs/httpd-error.log
php     3308 webmail    8u  VREG 151,131079        0 1474629
/u1/jails/jail-webmail/www/servers/webmail108/logs/httpd-error.log
php     3308 webmail    9u  VREG 151,131079        0 1474630
/u1/jails/jail-webmail/www/servers/webmail107/logs/httpd-error.log
php     3308 webmail   10u  VREG 151,131079        0 1474631
/u1/jails/jail-webmail/www/servers/webmail106/logs/httpd-error.log
php     3308 webmail   11u  VREG 151,131079        0 1474632
/u1/jails/jail-webmail/www/servers/webmail105/logs/httpd-error.log
php     3308 webmail   12u  VREG 151,131079        0 1474633
/u1/jails/jail-webmail/www/servers/webmail104/logs/httpd-error.log
php     3308 webmail   13u  VREG 151,131079        0 1474634
/u1/jails/jail-webmail/www/servers/webmail103/logs/httpd-error.log
php     3308 webmail   14u  VREG 151,131079        0 1474635
/u1/jails/jail-webmail/www/servers/webmail102/logs/httpd-error.log
php     3308 webmail   15u  VREG 151,131079        0 1474636
/u1/jails/jail-webmail/www/servers/webmail101/logs/httpd-error.log
php     3308 webmail   16u  VREG 151,131079        0 1474637
/u1/jails/jail-webmail/www/servers/webmail100/logs/httpd-error.log
php     3308 webmail   17u  VREG 151,131079     2109 1474254
/u1/jails/jail-webmail/www/servers/webmail/logs/httpd-error.log
php     3308 webmail   18w  VREG 151,131079      675 1474236
/u1/jails/jail-webmail/www/logs/httpd-access.log
php     3308 webmail   19w  VREG 151,131079        0 1474638
/u1/jails/jail-webmail/www/servers/webmail109/logs/httpd-access.log
php     3308 webmail   20w  VREG 151,131079        0 1474639
/u1/jails/jail-webmail/www/servers/webmail108/logs/httpd-access.log
php     3308 webmail   21w  VREG 151,131079        0 1474640
/u1/jails/jail-webmail/www/servers/webmail107/logs/httpd-access.log
php     3308 webmail   22w  VREG 151,131079        0 1474641
/u1/jails/jail-webmail/www/servers/webmail106/logs/httpd-access.log
php     3308 webmail   23w  VREG 151,131079        0 1474642
/u1/jails/jail-webmail/www/servers/webmail105/logs/httpd-access.log
php     3308 webmail   24w  VREG 151,131079        0 1474643
/u1/jails/jail-webmail/www/servers/webmail104/logs/httpd-access.log
php     3308 webmail   25w  VREG 151,131079        0 1474644
/u1/jails/jail-webmail/www/servers/webmail103/logs/httpd-access.log
php     3308 webmail   26w  VREG 151,131079        0 1474645
/u1/jails/jail-webmail/www/servers/webmail102/logs/httpd-access.log
php     3308 webmail   27w  VREG 151,131079        0 1474646
/u1/jails/jail-webmail/www/servers/webmail101/logs/httpd-access.log
php     3308 webmail   28w  VREG 151,131079        0 1474647
/u1/jails/jail-webmail/www/servers/webmail100/logs/httpd-access.log
php     3308 webmail   29w  VREG 151,131079     7821 1474255
/u1/jails/jail-webmail/www/servers/webmail/logs/httpd-access.log
--snipp--

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org