ID:               27229
 User updated by:  dodell at sitetronics dot com
 Reported By:      dodell at sitetronics dot com
 Status:           Open
 Bug Type:         Reproducible crash
 Operating System: FreeBSD 5.1-RELEASE-p13
 PHP Version:      4.3.4
 New Comment:

My arrays were too large; updating refcount from a 

ushort to a ulong has fixed my problem -- except, the 

question remains, why's it dumping core in FreeBSD 5.x 

and not in 4.x?


Previous Comments:
------------------------------------------------------------------------

[2004-02-13 03:15:52] [EMAIL PROTECTED]

I couldn't reproduce this on ANY system I tried. Linux with 4.3.2,
4.3.3 and 4.3.5dev, freebsd (4.9) with 4.3.5dev... all work fine,
valgrind shows nothing (on Linux)... no clue what'sgoing on.

------------------------------------------------------------------------

[2004-02-13 02:35:48] dodell at sitetronics dot com

This snapshot does not fix the problem. Again, the 

application works under the same environment using PHP 5 

beta 4.



Derick asked me off the record to try this on a FreeBSD 

4.x system.



test# php -q test.php

PHP Notice:  Undefined index:  ae in /usr/home/dodell/

test.php on line 28

PHP Notice:  Undefined index:  ai in /usr/home/dodell/

test.php on line 29

PHP Notice:  Undefined index:  ai in /usr/home/dodell/

test.php on line 30

PHP Notice:  Undefined offset:  65535 in /usr/home/

dodell/test.php on line 37

Array

(

)

php in free(): warning: chunk is already free

php in free(): warning: chunk is already free



These problems continue to persist with the latest 

development version.

------------------------------------------------------------------------

[2004-02-12 20:50:09] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Cannot replicate using latest CVS. 

------------------------------------------------------------------------

[2004-02-12 14:33:29] dodell at sitetronics dot com

This code does essentially the same operations as the code I'm using
and produces the same error.



This is FreeBSD package ``mod_php4-4.3.4_6,1''



<?php

$string = "a 1 ab 2 ac 5 ad 5 ae 5 af 5 ag 5 ah 5 ai 5 aj 5 ak 5 al

a 1 ab 2 ac 5 ad 5 ae 5 af 5 ag 5 ah 5 ai 5 aj 5 ak 5 al

a 1 ab 2 ac 5 ad 5 ae 5 af 5 ag 5 ah 5 ai 5 aj 5 ak 5 al

a 1 ab 2 ac 5 ad 5 ae 5 af 5 ag 5 ah 5 ai 5 aj 5 ak 5 al

a 1 ab 2 ac 5 ad 5 ae 5 af 5 ag 5 ah 5 ai 5 aj 5 ak 5 al

a 1 ab 2 ac 5 ad 5 ae 5 af 5 ag 5 ah 5 ai 5 aj 5 ak 5 al

a 1 ab 2 ac 5 ad 5 ae 5 af 5 ag 5 ah 5 ai 5 aj 5 ak 5 al";



$regex = "(\w{1}) \d{1} (\w{2}) \d{1} (\w{2}) \d{1} (\w{2}) \d{1}
(\w{2}) \d{1} (\w{2})

\d{1} (\w{2}) \d{1} (\w{2}) \d{1} (\w{2}) \d{1} (\w{2}) \d{1} (\w{2})
\d{1} (\w{2})";



$matches = array();



preg_match_all("/$regex/mi", $string, $matches);

$date = date('Y-m-d', time());

$packet_matches = array();



$i = 0;

$num_matches = count($matches[0]);



array_shift($matches);

array_multisort($matches[2], SORT_ASC);



$t = array('aj'=>0, 'ja'=>0);

$p_p = array('a'=>0, 'b'=>0, 'ai'=>0);

$diff = $s_p = $s_t = array_fill (0, 65535, 0);

for ($i = 0; $i < $num_matches; $i++) {

        $p_p[$matches[4][$i]]++;

        $s_p[$matches[8][$i]]++;

        $s_t[$matches[8][$i]] += $matches[11][$i];

        $t[$matches[9][$i]] += $matches[11][$i];

}



function _a_d($array) {

        $a = array();

        for ($i = 0; $i < count($array); $i++)

                if ($array[$i] != 0) $a[] = $array[$i];

        return $a;

}



$s_p = _a_d($s_p, $diff);

print_r($s_p);

?>

------------------------------------------------------------------------

[2004-02-12 11:11:46] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/27229

-- 
Edit this bug report at http://bugs.php.net/?id=27229&edit=1

Reply via email to