Bug #11990 Updated: defined constants getting corrupted
| From: | blalor at insight dot com | Date: | Tue, 10 Jul 2001 21:45:20 +0000 |
| Subject: | Bug #11990 Updated: defined constants getting corrupted | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-59630@lists.php.net to get a copy of this message | ||
ID: 11990
User updated by: blalor@insight.com
Reported By: blalor@insight.com
Old Status:
Status: Feedback
Bug Type: Scripting Engine problem
Operating System: RedHat Linux 6.2
PHP Version: 4.0.5
New Comment:
Well, I haven't succeeded yet in reproducing the corrupted define, but I have managed to
repeatably kill PHP with a 200002 line script generated by the following shell script:
echo "<?php"
define="this is a very long define, indeed! asdf asdf asdf asdf asdf asdf asdf asdf
asdf asdf asdf asdf asdf asdf asdf asdf"
count=0
while [ $count -lt 100000 ]; do
echo "define(\"DEF_${count}\", \"$define\");"
echo "if(DEF_${count} != \"$define\") { print(\"bad\"); }"
count=$(($count + 1))
done
echo "?>"
I redirected that to a file and ran php through gdb. here's the resulting stack trace:
(gdb) run
Starting program: /home/blalor/redhat/BUILD/php-4.0.6/php_standalone ../test.php
Program received signal SIGSEGV, Segmentation fault.
0x812770b in execute (op_array=0x81dc6c4) at ./zend_execute.c:1639
(gdb) bt
#0 0x812770b in execute (op_array=0x81dc6c4) at ./zend_execute.c:1639
#1 0x80ee58b in zend_execute_scripts (type=8, file_count=3) at zend.c:752
#2 0x80635a1 in php_execute_script (primary_file=0xbffff554) at main.c:1206
#3 0x80615c9 in main (argc=2, argv=0xbffff5b4) at cgi_main.c:718
[snip]
(gdb) print valptr->value
$1 = {lval = 136194132, dval = 1.067726779661273e-313, str = {
val = 0x81e2854 "DEF_0", len = 5}, ht = 0x81e2854, obj = {ce = 0x81e2854,
properties = 0x5}}
Note that it appears that PHP is trying to access the data for DEF_0 at zend_execute.c:1639.
Note that I did this with php 4.0.6, not 4.0.5. *Some* kind of problem still exists there...
Previous Comments:
------------------------------------------------------------------------
[2001-07-10 17:43:05] blalor@insight.com
Configure options:
./configure --prefix=/usr --with-config-file-path=/etc --with-apxs=/usr/sbin/apxs
--with-exec-dir=/usr/bin --disable-magic-quotes --enable-track-vars --enable-wddx --without-mysql
--with-oci8=/home/oracle/product/8.0.5 --with-esoob=/usr/local/easysoft/oob/client --enable-sockets
--disable-pear --with-xml --enable-inline-optimization
Having difficulty reproducing bug; it is very intermittent...
------------------------------------------------------------------------
[2001-07-09 19:51:36] sniper@php.net
Would it be possible to test this same script with PHP 4.0.6? I don't remember anyone reporting
anything like this before and I have never experienced anything like this myself.
Also, if you could create a short bug complete script
which could be used to reproduce this, it would
be a lot easier to debug this issue.
And what was your configure line used to configure PHP ?
--Jani
------------------------------------------------------------------------
[2001-07-09 18:13:11] blalor@insight.com
We're seeing severe data corruption problems with defines.
For example, the following snippet is from a PHP script that uses defined constants to build up a
filename. The resulting variable contains junk data.
no exist :ieldp/cðÃ<Äclasssupport/getproductlist.php
Warning: Failed opening 'ield' for inclusion (include_path='.:/u/php:/u/htdocs')
in /u/php/corelib/sp/procedure.php on line 57
no exist :ieldp/cðÃ<Äclasssupport/getfullproduct.php
Warning: Failed opening 'ield' for inclusion (include_path='.:/u/php:/u/htdocs')
in /u/php/corelib/sp/procedure.php on line 57
PHP doesn't seem to crash.
------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11990&edit=1