|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-04-05 09:21 UTC] scottmac@php.net
[2011-04-05 11:53 UTC] wwwound at gmail dot com
[2011-04-12 20:24 UTC] iliaa@php.net
[2011-04-12 20:24 UTC] iliaa@php.net
-Status: Open
+Status: Wont fix
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 04:00:01 2025 UTC |
Description: ------------ PHP crashes when passing large object ( with __toString() method ) to string functions (like substr(), urlencode() etc.) Test script: --------------- <?php class Foo { protected $obj; function rec($i = 0, $obj) { $this -> obj = $obj; // >5603 - segmentation fault or zend_mm_heap corrupted // With some values can work as expected if ( $i < 15604) { $this -> rec(++$i, $this); } } function __toString() { $this -> rec(0, $this); return "Hello, world!"; } } $foo = new Foo(); substr($foo, 0, 5); // This is ok //echo "\nHello!\n"; // But if we begin using variables "zend_mm_heap corrupted" or "Segmentation Fault" $a = "aaaaa\n"; echo $a; ?> Expected result: ---------------- Expecting correct appication exit Actual result: -------------- "Segmentation Fault" or "zend_mm_heap corrupted" errors