php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26965 Apache 2 Seg Faults on All PHP Pages
Submitted: 2004-01-19 10:33 UTC Modified: 2004-01-22 09:41 UTC
From: louis at 6internet dot com Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 5CVS-2004-01-20 OS: Red Hat Enterprise Linux ES v3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: louis at 6internet dot com
New email:
PHP Version: OS:

 

 [2004-01-19 10:33 UTC] louis at 6internet dot com
Description:
------------
Compiled PHP against Apache 2 in Red Hat Enterprise Linux 
ES v3 and even loading a .php file which contains ONLY 
HTML causes Apache to segmentation fault and write to the 
error_log. 
  
Similar to bug #26893, but different backtrace. 

Reproduce code:
---------------
Any plain HTML file or PHP file saved with .php extension

Expected result:
----------------
HTML code passed to browser 

Actual result:
--------------
Browser loses connection and Apache seg faults. 
 
Output when run through gdb, once apache process seg 
faults: 
 
Program received signal SIGSEGV, Segmentation fault. 
[Switching to Thread -1223485504 (LWP 9481)] 
0xb6fe8272 in _zend_hash_index_update_or_next_insert 
(ht=0xb705cd50, h=0, 
    pData=0xbfffa5e0, nDataSize=12, pDest=0x0, flag=1) 
    at /root/php-5.0.0b3/Zend/zend_hash.c:348 
348     /root/php-5.0.0b3/Zend/zend_hash.c: No such file 
or directory. 
        in /root/php-5.0.0b3/Zend/zend_hash.c 
(gdb) bt 
#0  0xb6fe8272 in _zend_hash_index_update_or_next_insert 
(ht=0xb705cd50, h=0, 
    pData=0xbfffa5e0, nDataSize=12, pDest=0x0, flag=1) 
    at /root/php-5.0.0b3/Zend/zend_hash.c:348 
#1  0xb6fe9a53 in zend_list_insert (ptr=0x0, type=0) 
    at /root/php-5.0.0b3/Zend/zend_list.c:47 
#2  0xb6fe9b86 in zend_register_resource (rsrc_result=0x0, 
    rsrc_pointer=0xb688313c, rsrc_type=2) 
    at /root/php-5.0.0b3/Zend/zend_list.c:99 
#3  0xb6fc193c in _php_stream_alloc (ops=0x0, 
abstract=0x0, persistent_id=0x0, 
    mode=0xb70085f1 "rb") at 
/root/php-5.0.0b3/main/streams/streams.c:248 
#4  0xb6fc54cb in _php_stream_fopen_from_fd (fd=16, 
mode=0xb70085f1 "rb", 
    persistent_id=0x0) at 
/root/php-5.0.0b3/main/streams/plain_wrapper.c:262 
#5  0xb6fc5291 in _php_stream_fopen ( 
    filename=0x81cd9d8 "/var/www/html/index.php", 
mode=0xb70085f1 "rb", 
    opened_path=0xbfffbb28, options=133) 
    at /root/php-5.0.0b3/main/streams/plain_wrapper.c:139 
#6  0xb6fc6500 in _php_stream_fopen_with_path ( 
    filename=0x81cd9d8 "/var/www/html/index.php", 
mode=0xb70085f1 "rb", 
    path=0xb7026112 ".:/usr/local/lib/php", 
opened_path=0xbfffbb28, 
    options=133) at 
/root/php-5.0.0b3/main/streams/plain_wrapper.c:1199 
#7  0xb6fc5f87 in php_plain_files_stream_opener 
(wrapper=0xb70533a8, 
    path=0x81cd9d8 "/var/www/html/index.php", 
mode=0xb70085f1 "rb", 
    options=133, opened_path=0xbfffbb28, context=0x0) 
---Type <return> to continue, or q <return> to quit--- 
    at /root/php-5.0.0b3/main/streams/plain_wrapper.c:886 
#8  0xb6fc37a6 in _php_stream_open_wrapper_ex ( 
    path=0x81cd9d8 "/var/www/html/index.php", 
mode=0xb70085f1 "rb", 
    options=141, opened_path=0x85, context=0x0) 
    at /root/php-5.0.0b3/main/streams/streams.c:1613 
#9  0xb6fb3cb7 in php_stream_open_for_zend ( 
    filename=0x81cd9d8 "/var/www/html/index.php", 
handle=0xbfffbb20) 
    at /root/php-5.0.0b3/main/main.c:880 
#10 0xb6feef8e in zend_stream_open ( 
    filename=0x81cd9d8 "/var/www/html/index.php", 
handle=0xbfffbb20) 
    at /root/php-5.0.0b3/Zend/zend_stream.c:41 
#11 0xb6fef068 in zend_stream_fixup 
(file_handle=0xbfffbb20) 
    at /root/php-5.0.0b3/Zend/zend_stream.c:56 
#12 0xb6fcc9e6 in open_file_for_scanning 
(file_handle=0xbfffbb20) 
    at Zend/zend_language_scanner.c:3041 
#13 0xb6fccafe in compile_file (file_handle=0xbfffbb20, 
type=2) 
    at Zend/zend_language_scanner.c:3127 
#14 0xb6fe37f1 in zend_execute_scripts (type=2, 
retval=0x0, file_count=1) 
    at /root/php-5.0.0b3/Zend/zend.c:1044 
#15 0xb7006552 in php_handler (r=0x81cc1d8) 
    at 
/root/php-5.0.0b3/sapi/apache2handler/sapi_apache2.c:533 
#16 0x08068685 in ap_run_handler () 
#17 0x08068c9f in ap_invoke_handler () 
---Type <return> to continue, or q <return> to quit--- 
#18 0x08065326 in ap_process_request () 
#19 0x0806095c in _start () 
#20 0x081cc1d8 in ?? () 
#21 0x00000004 in ?? () 
#22 0x081cc1d8 in ?? () 
#23 0x0807228c in ap_run_pre_connection () 
#24 0x08072145 in ap_run_process_connection () 
#25 0x08066ba1 in ap_graceful_stop_signalled () 
#26 0x08066dba in ap_graceful_stop_signalled () 
#27 0x08066e16 in ap_graceful_stop_signalled () 
#28 0x0806763d in ap_mpm_run () 
#29 0x0806dacf in main () 
(gdb) 
 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-20 19:30 UTC] sniper@php.net
What MPM is used with Apache?
What was the configure line used to configure PHP?
How was PHP configured in Apache httpd.conf?

 [2004-01-21 06:20 UTC] louis at 6internet dot com
Thanks for coming back sniper.


httpd -l gives me:
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

So I think that means the prefork MPM is in use.


PHP was compiled with:

./configure --with-apxs2=/usr/sbin/apxs --with-pgsql


Lines added to /etc/httpd/conf/httpd.conf:

LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php


Many thanks
 [2004-01-21 14:50 UTC] sniper@php.net
Does this crash happen with CLI ??

 [2004-01-22 05:59 UTC] louis at 6internet dot com
No, PHP on the command line seems to be working ok.  Passing PHP the plain HTML file on the command line outputs the HTML as expected, whereas in Apache 2 it seg faults.

Just to clarify, two files (index.html and index.php) which are identical and contain simply:

<html>
<head>
    <title>Test</title>
</head>

<body>
A test for php
</body>
</html>

But, loading index.html displays fine as expected while loading index.php seg faults.

Please do let me know if any more info would help diagnosis.  I may be able to arrange full root access to the system if that would help?  It is just a test RHEL ES v3 system with nothing except PHP 5 added yet because I haven't got it working yet.  If so please let me know what address to mail the IP/password to off the bug database.
 [2004-01-22 06:53 UTC] sniper@php.net
Must be something wrong with your system as I'm running PHP 5 in Apache2 and don't get any segfaults..(if you can provide access to this machine, send me the details to sniper@php.net)

 [2004-01-22 09:41 UTC] sniper@php.net
Your OS comes with preinstalled Apache2+PHP. 
You need to remove the preinstalled PHP to fix this.

(more detailed explanation sent via email)

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 20:01:45 2024 UTC