| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2001-07-09 18:13 UTC] blalor at insight dot 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 13:00:02 2025 UTC | 
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...