Bug #53663 [Fbk->NoF]: fatal error with bad memory allocation in a script echo & exit

From: Date: Tue, 15 Oct 2013 11:54:27 +0000
Subject: Bug #53663 [Fbk->NoF]: fatal error with bad memory allocation in a script echo & exit
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182179@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=53663&edit=1

 ID:               53663
 Updated by:       php-bugs@lists.php.net
 Reported by:      sskaje at gmail dot com
 Summary:          fatal error with bad memory allocation in a script
                   echo & exit
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          Scripting Engine problem
 Operating System: Linux/CentOS
 PHP Version:      5.3.4
 Private report:   N

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.


Previous Comments:
------------------------------------------------------------------------
[2013-03-04 09:18:01] dlsniper@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.4-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

I've just tried to reproduce this against PHP 5.4.12 and Apache and I couldn't get the
crash mentioned.
Same goes when trying the scripts against nginx.
Please try to upgrade to a newer version of PHP and check if the problem still exists for you.
I'll close this in 2 weeks if no further feedback.

------------------------------------------------------------------------
[2011-01-17 04:45:42] sskaje at gmail dot com

Whats' more, script without the echo...exit stuff like :

::::::::::::::
test.php
::::::::::::::
<?php

require(__DIR__ . '/Controller.php');

class test extends TestController
{
    public function action()
    {
        $this->output = 'Hello';
        $this->display('raw');
    }
}
new test;


works perfectly.

die('a') performs as same as the echo...exit.

------------------------------------------------------------------------
[2011-01-17 04:42:43] sskaje at gmail dot com

@Stas: I upgrade my php to 5.3.5 and the memory allocation message disappeared 
while a *no response* request still exists.

php scripts:

[root@dev test]# more test*.php > /tmp/php.txt
[root@dev test]# cat /tmp/php.txt 
::::::::::::::
test1.php
::::::::::::::
<?php

echo 'a';
exit;
require(__DIR__ . '/Controller.php');

class test extends TestController
{
    public function action()
    {
        $this->output = 'Hello';
        $this->display('raw');
    }
}
new test;
::::::::::::::
test2.php
::::::::::::::
<?php

echo 'a';
exit;

__halt_compiler();
require(__DIR__ . '/Controller.php');

class test extends TestController
{
    public function action()
    {
        $this->output = 'Hello';
        $this->display('raw');
    }
}
new test;
::::::::::::::
test3.php
::::::::::::::
<?php

echo 'a';
exit;

require(__DIR__ . '/Controller.php');

__halt_compiler();
class test extends TestController
{
    public function action()
    {
        $this->output = 'Hello';
        $this->display('raw');
    }
}
new test;
::::::::::::::
test4.php
::::::::::::::
<?php

echo 'a';
exit;

require(__DIR__ . '/Controller.php');

class test extends TestController
{
    public function action()
    {
        $this->output = 'Hello';
        $this->display('raw');
    }
}
__halt_compiler();
new test;


==============
Controller.php:
[root@dev test]# more Controller.php 
<?php
/**
 * 业务 TestController
 * 
 */

require(__DIR__ . '/../ControllerBase.php');

abstract class TestController extends ControllerBase
{
    public function __construct()
    {
        # 禁用 GPC
        $this->diable_gpc();
        
        $this->checkPara();
        $this->action();
    }


    public function __destruct()
    {
        if (!empty($this->output)) {
            # 默认输出
            $this->display();
            unset($this->output);
        }
    }
}

# EOF


==========================
Results:
 test1.php: no http response returned.
 test2.php: http 200 and an output of 'a'
 test3.php: same as test2.php
 test4.php: same as test1.php

------------------------------------------------------------------------
[2011-01-16 22:09:33] stas@php.net

Could you please post exact script that doesn't work? I tried some permutations of uncommenting
stuff in your example and no one of them led to the error.

------------------------------------------------------------------------
[2011-01-06 09:17:17] sskaje at gmail dot com

The original script is like 

<?php

require(__DIR__ . '/blahsparent.php');
class blahblah extends blahsparent
{
    
}

new blahblah;

only if __halt_compiler(); was added before the line of 'class ....', error would not be
triggered.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=53663


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=53663&edit=1


Thread (8 messages)

« previous php.bugs (#182179) next »