From: friosa at pnpitalia dot it
Operating system: Linux 2.4.18-4GB
PHP version: 5.0.0b4 (beta4)
PHP Bug Type: Zend Engine 2 problem
Bug description: zend_variables.c problem
Description:
------------
I continue to get a core dump using imp with imap from the horde project.
The crash is reproducible but the gdb backtrace has changed after i've
inserted the debug code.
Also I think it's important to mention that if u substitute the
"var_dump()" code below with "print_r()" the crash disappear !!!
so we can switch this three cases:
case "code without debug": crash();
case "code with vardump($mime_part)": crash();
case "code with print_r($mime_part)": --> continue (but I can't still see
the page)
If I can help with something else please contact me, I' will keep a copy
of the code, also I can send U a tar.gz of all this stuff (may be not
usefull with my conf.)
follow:
PHP compiling flags
APACHE
PRINT_R
VARDUMP
*********************************************
* PHP compiling flags
*********************************************
CFLAGS = CPPFLAGS = -march=k6 -O0 -pipe -fomit-frame-pointer -I[...]
./configure \
--prefix=/TEST/php \
--with-apxs2=/TEST/apache/bin/apxs \
--with-config-file-path=/TEST/php/lib/php.ini \
--with-informix=/opt/informix \
--with-mysql=/pnp/mysql \
--with-mysql-sock=/tmp/mysql.sock \
--enable-libgcc \
--with-curl=/pnp \
--disable-ipv6 \
--enable-ftp \
--with-openssl=/pnp \
--with-gd \
--enable-gd-native-ttf \
--with-zlib-dir=/usr \
--with-jpeg-dir=/usr \
--enable-exif \
--with-tiff-lib=/usr \
--with-png-dir=/usr \
--with-freetype-dir=/usr \
--with-pdflib=/TEST \
--enable-bcmath \
--enable-shmop \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-mime-magic \
--with-qtdom \
--enable-pcntl \
--enable-sockets \
--x-includes=/usr/X11/include/X11 \
--x-libraries=/usr/X11/lib \
--with-readline \
--with-gnu-ld \
--enable-static \
--with-gettext \
--with-libxml-dir=/TEST \
--with-xml=/TEST \
--with-dom=/TEST \
--with-xsl=/TEST \
--with-dom-xslt=/TEST \
--with-dom-exslt=/TEST \
--with-mcrypt=/pnp \
--with-imap \
--enable-debug \
&& make && make install
*********************************************
* APACHE
*********************************************
./httpd -V
Server version: Apache/2.1.0-dev
Server built: Jan 26 2004 12:02:10
Server's Module Magic Number: 20030821:3
Architecture: 32-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/TEST/apache"
-D SUEXEC_BIN="/TEST/apache/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"
*********************************************
* PRINT_R
*********************************************
MIME_Message Object
(
[_build] => 1
[_defaultServer] => www2.pnp
[_type] => text
[_subtype] => Array
(
[download] => download_attach
[view] => view_attach
)
[_contents] =>
[_transferEncoding] => 7bit
[_encode7bit] => 1
[_description] =>
[_disposition] => inline
[_dispositionParameters] => Array
(
)
[_contentTypeParameters] => 0
*********************************************
* VARDUMP
*********************************************
object(MIME_Message)#19 (19) {
["_build"]=>
bool(true)
["_defaultServer"]=>
string(8) "www2.pnp"
["_type"]=>
string(4) "text"
["_subtype"]=>
array(2) {
["download"]=>
string(15) "download_attach"
["view"]=>
string(11) "view_attach"
}
["_contents"]=>
string(0) ""
["_transferEncoding"]=>
string(4) "7bit"
["_encode7bit"]=>
bool(true)
["_description"]=>
string(0) ""
["_disposition"]=>
string(6) "inline"
["_dispositionParameters"]=>
array(0) {
}
["_contentTypeParameters"]=>
&UNKNOWN:0
["_parts"]=>
array(0) {
}
["_information"]=>
UNKNOWN:0
["_bytes"]=>
object(MIME_Message)#19 (19) {
["_build"]=>
bool(true)
["_defaultServer"]=>
string(8) "www2.pnp"
["_type"]=>
string(4) "text"
["_subtype"]=>
array(2) {
["download"]=>
string(15) "download_attach"
["view"]=>
string(11) "view_attach"
}
["_contents"]=>
string(0) ""
["_transferEncoding"]=>
string(4) "7bit"
["_encode7bit"]=>
bool(true)
["_description"]=>
string(0) ""
["_disposition"]=>
string(6) "inline"
["_dispositionParameters"]=>
array(0) {
}
["_contentTypeParameters"]=>
&UNKNOWN:0
["_parts"]=>
array(0) {
}
["_information"]=>
UNKNOWN:0
["_bytes"]=>
*RECURSION*
["_cids"]=>
array(0) {
}
["_mimeid"]=>
UNKNOWN:0
["_eol"]=>
string(1) "
"
["_flags"]=>
UNKNOWN:0
["_idmap"]=>
array(0) {
}
}
["_cids"]=>
array(0) {
}
["_mimeid"]=>
UNKNOWN:0
["_eol"]=>
string(1) "
"
["_flags"]=>
UNKNOWN:0
["_idmap"]=>
array(0) {
}
}
Reproduce code:
---------------
class MIME_Contents {
[...]
function buildMessagePart(&$mime_part)
{
$msg = '';
if (!$this->canDisplayInline($mime_part) &&
($mime_part->getMIMEId() != 0)) {
if (($this->_displayType == 'list') ||
($this->_displayType == 'both')) {
$this->setSummary($mime_part, 'attachment');
}
if (($this->_displayType == 'inline') ||
($this->_displayType == 'both')) {
$this->setSummary($mime_part, 'part');
}
} else {
// poor man debug code ...
echo "<pre>";
var_dump($mime_part);
echo "pippo".$i++; str_pad(" ", 300); ob_flush();flush();
echo "</pre>";
// ... poor man debug code
///// CRASH HERE, FIRST LINE OF "$this->renderMIMEPart($mime_part);"
WILL NEVER EXECUTED
$msg = $this->renderMIMEPart($mime_part);
[...]
Actual result:
--------------
gdb ./httpd
GNU gdb 5.1.1
[...]
(gdb) run -X -f /TEST/apache/conf/httpd.conf
Starting program: /TEST/apache/bin/./httpd -X -f
/TEST/apache/conf/httpd.conf
[New Thread 1024 (LWP 30012)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 30012)]
0x4066c571 in _zval_dtor (zvalue=0x4127d6a0, __zend_filename=0x406ed780
"/TEST/php-5.0.0b4/Zend/zend_execute_API.c", __zend_lineno=359)
at /TEST/php-5.0.0b4/Zend/zend_variables.c:44
44 CHECK_ZVAL_STRING_REL(zvalue);
(gdb) bt
#0 0x4066c571 in _zval_dtor (zvalue=0x4127d6a0,
__zend_filename=0x406ed780 "/TEST/php-5.0.0b4/Zend/zend_execute_API.c",
__zend_lineno=359)
at /TEST/php-5.0.0b4/Zend/zend_variables.c:44
#1 0x412b11cc in ?? ()
#2 0x406972f7 in zend_do_fcall_common_helper (execute_data=0x40cf4b64,
opline=0x406f2a20, op_array=0x74) at
/TEST/php-5.0.0b4/Zend/zend_execute.c:2671
#3 0x406972f7 in zend_do_fcall_common_helper (execute_data=0x40cf4b64,
opline=0x406f2a20, op_array=0x74) at
/TEST/php-5.0.0b4/Zend/zend_execute.c:2671
#4 0x406972f7 in zend_do_fcall_common_helper (execute_data=0x40cf4b64,
opline=0x406f2a20, op_array=0x74) at
/TEST/php-5.0.0b4/Zend/zend_execute.c:2671
#5 0x406972f7 in zend_do_fcall_common_helper (execute_data=0x40cf4b64,
opline=0x406f2a20, op_array=0x74) at
/TEST/php-5.0.0b4/Zend/zend_execute.c:2671
#6 0x4066eaf7 in zend_execute_scripts (type=0, retval=0x0, file_count=4)
at /TEST/php-5.0.0b4/Zend/zend.c:1052
(gdb)
--
Edit bug report at http://bugs.php.net/?id=27469&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27469&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27469&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27469&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27469&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27469&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27469&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27469&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27469&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27469&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27469&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27469&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27469&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27469&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27469&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27469&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27469&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27469&r=float