From: Jurijs Cerepanovs <Jurijs dot Cerepanovs at lattelecom dot lv
Operating system: Linux (Slackware/SuSE)
PHP version: 5.2.6
PHP Bug Type: Reproducible crash
Bug description: Output buffering produces segmentation fault
Description:
------------
Output buffering gets segmentation fault
Reproduce code:
---------------
<?php
function ob_bug($buf)
{
$full_buf = ob_get_clean();
return $full_buf;
}
ob_start("ob_bug");
echo "test";
exit();
?>
Expected result:
----------------
$full_buf and $buf contains buffer
Actual result:
--------------
(gdb) run -q ob_bug.php
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/php -q ob_bug.php
[New Thread 16384 (LWP 1860)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 1860)]
0x08255a92 in _zend_mm_alloc_int (heap=0x8534208, size=32) at
/usr/src/websvr/php-5.2.1/Zend/zend_alloc.c:1497
1497 zend_mm_add_to_free_list(heap,
new_free_block);
(gdb) run -q ob_bug.php
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/php -q ob_bug.php
[New Thread 16384 (LWP 1873)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 1873)]
0x08256565 in _emalloc (size=16) at
/usr/src/websvr/php-5.2.1/Zend/zend_alloc.c:1866
1866 return _zend_mm_alloc_int(AG(mm_heap), size
ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
(gdb) run -q ob_bug.php
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/php -q ob_bug.php
[New Thread 16384 (LWP 1875)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 1875)]
zend_call_function (fci=0xbfd01080, fci_cache=0x0) at
/usr/src/websvr/php-5.2.1/Zend/zend_execute_API.c:615
615 zend_class_entry *calling_scope = NULL;
--
Edit bug report at http://bugs.php.net/?id=45010&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45010&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45010&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45010&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45010&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45010&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45010&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45010&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45010&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45010&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45010&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45010&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45010&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45010&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45010&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45010&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45010&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45010&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45010&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45010&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45010&r=mysqlcfg