From:             [EMAIL PROTECTED]
Operating system: Linux, Windows
PHP version:      4.0CVS-2002-03-30
PHP Bug Type:     Reproducible crash
Bug description:  Overflow in Array functions

If the memory limit of a PHP-script gets exhausted, the PHP interpreter
does'nt shut down cleanly and print an error regarding this issue; it
segfaults. If the user enables following options in php.ini
([PHP]-section),
---
log_errors = On
error_log = syslog
---
PHP first shows an memory-limit error, after that Apache/PHP dies with an
segmentation fault. If "error_log" is set to "/some/file", PHP is unable
to log anything. The only logging facility that logs the segmentation
fault is syslog.

Demonstration:
<?php
  $theline = "hello, i'm the line";
  for ($i = 0; $i < 1000000; $i++) $testarr[$i] = $theline;
?>

Following script does'nt cause a segmentation fault:
<?php
  for ($i = 0; $i < 1000000; $i++) $testarr[$i] = "hello, i'm the line";
?>

So far we could test following Versions:
PHP      Webserver     OS              console (sf/ml)  apachemod (sf/ml)
4.0.1    -             Linux ?                   X/-                -/-
4.0.2    Apache 1.3.?  Linux ?                   ?/?                ?/?
4.0.6    Apache 1.3.19 Linux 2.2.19              X/X                X/X
4.0.6    Apache 1.3.22 Linux 2.4.18              X/X                X/X
4.1.2    Apache 1.3.22 Linux ?                   X/X                X/X
4.1.2    -             Linux 2.4.17              X/X                -/-
4.1.2    Apache 1.2.24 Windows 2000              X/-                X/-
4.2.0rc1 Apache 1.3.24 Linux 2.4.18              -/X                X/X

* sf = Segmentation fault
* ml = Memory limit error
-- 
Edit bug report at http://bugs.php.net/?id=16360&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=16360&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=16360&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=16360&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16360&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16360&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16360&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=16360&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=16360&r=submittedtwice

Reply via email to