Bug #25410 [Com]: strange crash & freeze bug when reassigning global var to method's return
| From: | lildurk25410 at gmail dot com | Date: | Wed, 01 Sep 2021 18:52:55 +0000 |
| Subject: | Bug #25410 [Com]: strange crash & freeze bug when reassigning global var to method's return | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236337@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=25410&edit=1
ID: 25410
Comment by: lildurk25410 at gmail dot com
Reported by: xuefer at 21cn dot com
Summary: strange crash & freeze bug when reassigning global
var to method's return
Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: win
PHP Version: 4.3.3
Block user comment: N
Private report: N
New Comment:
Lil Durk is a private agency dedicated to providing responsible access to legal cannabis for adults
aged 19 and older. Weâre an exclusively online retailer and wholesaler for recreational
cannabis and a trusted source for information about cannabis and cannabis-related issues. We believe
our work is meaningful and we take pride in our mandate to promote the socially responsible use of
legal cannabis. https://lildurk.com/
Previous Comments:
------------------------------------------------------------------------
[2003-09-07 11:11:02] sniper@php.net
Fixed in PHP 5. (ZE2, won't fix in PHP 4)
------------------------------------------------------------------------
[2003-09-07 06:13:39] xuefer at 21cn dot com
Description:
------------
the 1st code make apache crash, and the 2nd make apache freeze, taking full cpu usage
notice that the "exit" statement is important
noting will happend when "exit" is removed
only class methods is affected, not function
Reproduce code:
---------------
crash:
<?php
class A
{
function &getInstance()
{
if (empty($GLOBALS['a'])) {
$GLOBALS['a'] = &new A();
}
return $GLOBALS['a'];
}
}
$a = &A::getInstance();
exit;
?>
freeze:
<?php
class A
{
function &getInstance()
{
return $GLOBALS['a'];
}
}
$a = &A::getInstance();
exit;
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=25410&edit=1