php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27898 HEAD request makes httpd hang
Submitted: 2004-04-07 03:51 UTC Modified: 2004-04-09 14:34 UTC
From: wiwi at progon dot net Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4CVS, 5CVS (2004-04-07) OS: FreeBSD 5.2.1p4
Private report: No CVE-ID: None
 [2004-04-07 03:51 UTC] wiwi at progon dot net
Description:
------------
Looks as if bug #5649 is back again. This happend only with .php scripts, plain html ist just fine. 

I tried the following configs without any change:
  ./configure  --with-openssl --with-pgsql --with-apxs2=/usr/local/apache2/bin/apxs 
  ./configure  --with-pgsql --with-apxs2=/usr/local/apache2/bin/apxs
  ./configure  --with-apxs2=/usr/local/apache2/bin/apxs  

I tried the following php versions without any change:
  4.3.4
  4.3.5
  4.3.6RC2

I tried the following apache version without any change:
  2.0.48
  2.0.49

gdb output is not useful, as I have to use ctrl-c to stop the hanging program:

Program received signal SIGINT, Interrupt.
0x2863749c in _thread_sig_handle_pending () from /usr/lib/libc_r.so.5
(gdb) where
#0  0x2863749c in _thread_sig_handle_pending () from /usr/lib/libc_r.so.5
#1  0x28636d32 in _thread_sig_handler () from /usr/lib/libc_r.so.5
#2  0x28636f34 in _thread_sig_handler () from /usr/lib/libc_r.so.5
#3  0x2863803a in _thread_sig_wrapper () from /usr/lib/libc_r.so.5
#4  0xbfbfba60 in ?? ()
#5  0x286379f0 in _thread_sig_handle_pending () from /usr/lib/libc_r.so.5
#6  0x286372ff in _thread_sig_check_pending () from /usr/lib/libc_r.so.5
#7  0x2863d58e in _thread_kern_scheduler () from /usr/lib/libc_r.so.5

Reproduce code:
---------------
#!/bin/sh
while [ true ]
do
   curl -I http://a.php.script
done

Actual result:
--------------
a) curl times out (curl: (52) Empty reply from server)
b) httpd hangs and uses up all cpu time:
 2143 nobody   110    0  9044K  7152K RUN      0:06 10.86% 10.06% httpd
 2130 nobody   108    0  9068K  7448K RUN      0:09  9.86%  9.77% httpd
 2156 nobody   109    0  9024K  7236K RUN      0:02  8.61%  4.93% httpd
 2150 nobody    20    0  9020K  7368K lockf    0:02  5.12%  3.86% httpd
 2153 nobody    20    0  9008K  7356K lockf    0:01  5.17%  3.76% httpd
 2152 nobody    20    0  9008K  7352K lockf    0:02  4.70%  3.42% httpd
 2151 nobody    20    0  9008K  7384K lockf    0:02  4.70%  3.42% httpd
 2154 nobody    20    0  9008K  7336K lockf    0:01  4.93%  3.37% httpd
 2155 nobody   103    0  9008K  7352K RUN      0:01  5.09%  3.12% httpd

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-07 04:29 UTC] wiwi at progon dot net
5.0.0RC1 has the same problem.
 [2004-04-07 04:59 UTC] sniper@php.net
Have you tried with Apache1 (or apache2 with non-threaded MPM?)

 [2004-04-07 05:16 UTC] wiwi at progon dot net
No, I have no Apache 1.x server on my site.

We use the classical "prefork" MPM:

Server version: Apache/2.0.49
Server built:   Apr  6 2004 23:18:29
Server's Module Magic Number: 20020903:7
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/usr/local/apache2"
 -D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"
 [2004-04-07 05:45 UTC] sniper@php.net
Then install latest Apache 1.3.x and try with it..

 [2004-04-07 07:50 UTC] wiwi at progon dot net
php-5.0.0RC1, php-4.3.6RC2 and php-4.3.5 works fine with Apache 1.3.29.
 [2004-04-07 08:42 UTC] sniper@php.net
After running the script for couple of minutes I couldn't reproduce this (with Apache 2.0.47).

How exactly did you configure PHP in httpd.conf ?

 [2004-04-07 10:19 UTC] wiwi at progon dot net
I just tried 2.0.47 as well, and it crashes just as the other 2.0.x versions.

Server: Apache/2.0.47 (Unix) PHP/5.0.0RC1 mod_ssl/2.0.47 OpenSSL/0.9.7c-p1
X-Powered-By: PHP/5.0.0RC1

The relevant httpd.conf-entries are:
   LoadModule php5_module modules/libphp5.so
   AddType application/x-httpd-php .php

The php config unchanged ("make install").

The php script used to test the server is from:
   http://www.php.net/manual/en/tutorial.firstpage.php
 [2004-04-07 10:54 UTC] sniper@php.net
Is it only a HEAD request (single or many?) or any request of PHP script..?

 [2004-04-07 15:58 UTC] wiwi at progon dot net
Regular GET requests work fine, I got some 10000 hits within two hours without any problem. 

But I usually need only 10 to 20 HEAD ("curl -I") requests to make the server process hang.
 [2004-04-08 19:43 UTC] sniper@php.net
Can you check what these commands output:

# ldd /usr/local/apache2/bin/httpd

# ldd /usr/local/apache2/modules/libphp4.so

(neither should be linked with libc_r.so..)

 [2004-04-09 14:32 UTC] wiwi at progon dot net
Thank you for your help. 

I managed to build both php4 and php5 without libc_r. And it seems works! 

I am very impressed about your support! Thank you again! Can you shed some light on this library libc_r and its strange effects on php?
 [2004-04-09 14:34 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Problem was libc library on user's end. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC