Title: RE: Bug #11990 Updated: defined constants getting corrupted

The bug update page isn't accepting my changes; keeps telling me:
        The password you supplied was incorrect.
        Something went wrong updating the database.
I've got the right password.

Since I can't submit my updates via the form, here goes:

>>>>>>>>>>>>>>>
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...
<<<<<<<<<<<<<<<<


--
Brian Lalor
[EMAIL PROTECTED]
(v) 480-333-3196
(f) 480-760-9298

> -----Original Message-----
> From: Bug Database [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 09, 2001 4:52 PM
> To: [EMAIL PROTECTED]
> Subject: Bug #11990 Updated: defined constants getting corrupted
>
>
> ID: 11990
> Updated by: sniper
> Reported By: [EMAIL PROTECTED]
> Old Status: Open
> Status: Feedback
> Old Bug Type: *Programming Data Structures
> Bug Type: Scripting Engine problem
> Operating System: RedHat Linux 6.2
> PHP Version: 4.0.5
> New Comment:
>
> 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
>
>
> Previous Comments:
> --------------------------------------------------------------
> ----------
>
> [2001-07-09 18:13:11] [EMAIL PROTECTED]
>
> 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
>

Reply via email to