#24578 [Opn]: A stack overflow in a php-script leads to a segmentation fault.

From: Date: Fri, 11 Jul 2003 08:07:46 +0000
Subject: #24578 [Opn]: A stack overflow in a php-script leads to a segmentation fault.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-43740@lists.php.net to get a copy of this message
ID: 24578 User updated by: daniel dot goss at t-systems dot com Reported By: daniel dot goss at t-systems dot com Status: Open Bug Type: Reproducible crash Operating System: RedHat 8.0, 7.3 PHP Version: 4.3.2 New Comment: We've investigates the "second issue" and have reported it under Bug #24581. Previous Comments: ------------------------------------------------------------------------ [2003-07-11 02:56:31] bharat at menalto dot com Here's a very simple test case to reproduce this bug: <?php function crash($data) { crash(1); } crash(1); ?> ------------------------------------------------------------------------ [2003-07-10 03:34:13] daniel dot goss at t-systems dot com Description: ------------ I know this bug has been reported as "Bug #18909: Stack overflow error" but I think this should be fixed and not treated as bogus like in bug #18909. Scripting engines should _never_ segfault! A stack overflow in a recursive php-function leads the php-engine to a segmentation fault. There is a second issue that could be in associated with this one. If a function is called very often (sometimes recoursive - depth not greater than 20) php crashes too. We've not investigated this issue further enough to write a script to reproduce this behaviour. Reproduce code: --------------- <? function MyTest($A, $B, $C, $D, $E, $F, $G) { for ($k=0; $k<100; $k++) { echo "|".$A++."|<BR>"; flush(); MyTest($A, "", "", "", "", "", ""); } } MyTest(0,"","","","","",""); ?> Expected result: ---------------- A php error complaining about a stack overflow. Actual result: -------------- [notice] child pid 29029 exit signal Segmentation fault (11) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24578&edit=1

« previous php.bugs (#43740) next »