#35571 [NEW]: SSI + php (not using virtual()) causes Apache2 segfault

From: Date: Tue, 06 Dec 2005 15:57:13 +0000
Subject: #35571 [NEW]: SSI + php (not using virtual()) causes Apache2 segfault
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-89823@lists.php.net to get a copy of this message
From:             kclair at gmail dot com
Operating system: linux
PHP version:      4.4.1
PHP Bug Type:     Apache2 related
Bug description:  SSI + php (not using virtual()) causes Apache2 segfault

Description:
------------
SSI files which include php scripts are behaving differently after
upgrading from php 4.3.10 to php 4.4.1.
Apache version is 2.0.54.

I tried it with two different configure options:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-debug=no
--enable-versioning --enable-track-vars --with-openssl
--with-jpeg-dir=/home/sys/src/jpeg-6b --with-expat=/usr/lib --with-mcrypt
--with-config-file-path=/home/sys/etc/php-noZend/ --with-png-dir=/usr
--with-zlib-dir=/usr --with-ttf --with-freetype-dir=/usr --with-curl
--with-mysql=/usr --with-gd --with-sablot --with-xslt-sablot --enable-xslt
--disable-zend-memory-manager

./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-debug=no
--enable-versioning --enable-track-vars --with-openssl
--with-jpeg-dir=/home/sys/src/jpeg-6b --with-expat=/usr/lib --with-mcrypt
--with-config-file-path=/home/sys/etc/ --with-png-dir=/usr
--with-zlib-dir=/usr --with-ttf --with-freetype-dir=/usr --with-curl
--with-mysql=/usr --with-gd --with-sablot --with-xslt-sablot
--enable-xslt

I also tried it both with Zend optimizer enabled and with Zend optimizer
disabled in php.ini.

Reproduce code:
---------------
The includes from the files which segfault look like:
<!--#include file="eventsdb.php?ID=81&fld=2" -->

The php code is a short db query:

if ($conn == false){
 echo mysql_errno() . ": " . mysql_error() . "<BR>";
 exit;
       }
else {
  $rtn = mysql_select_db ("[tablename]");
  $sql = "select * from events where ID = ".$ID;
  $result = mysql_query ($sql);
  if ( ($row = mysql_fetch_row($result)) && ($today<=$row[4]
) ){
     mysql_fetch_row($result)) {
         [snip echo mysql results]
       }
     }
   }
}

Expected result:
----------------
Results from mysql query should be displayed on page.

Actual result:
--------------
Blank pages.

The backtrace is the same regardless of which compile options I used:

#0  0xb7e095cc in zend_hash_index_update_or_next_insert (ht=0xb7ea29c0,
h=0,
   pData=0xbfffdc60, nDataSize=12, pDest=0x0, flag=1)
   at /home/sys/src/php-4.4.1/Zend/zend_hash.c:390
390         p = ht->arBuckets[nIndex];
(gdb) bt full
#0  0xb7e095cc in zend_hash_index_update_or_next_insert (ht=0xb7ea29c0,
h=0,
   pData=0xbfffdc60, nDataSize=12, pDest=0x0, flag=1)
   at /home/sys/src/php-4.4.1/Zend/zend_hash.c:390
       nIndex = 0
       p = Variable "p" is not available.
(gdb)

-- 
Edit bug report at http://bugs.php.net/?id=35571&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35571&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35571&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35571&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=35571&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=35571&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=35571&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=35571&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=35571&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=35571&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=35571&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=35571&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=35571&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=35571&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=35571&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=35571&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=35571&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=35571&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=35571&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=35571&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=35571&r=mysqlcfg


Thread (6 messages)

« previous php.bugs (#89823) next »