php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76217 Yaf_Dispatcher::setDefault* memory leaks
Submitted: 2018-04-13 11:09 UTC Modified: 2021-09-15 16:28 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: fanjiapeng at 126 dot com Assigned:
Status: Open Package: yaf (PECL)
PHP Version: 7.2.4 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fanjiapeng at 126 dot com
New email:
PHP Version: OS:

 

 [2018-04-13 11:09 UTC] fanjiapeng at 126 dot com
Description:
------------
Involves three methods, Yaf_Dispatcher::setDefaultModule, Yaf_Dispatcher::setDefaultController, Yaf_Dispatcher::setDefaultAction

Test script:
---------------
/* Bootstrap.php */
<?php
class Bootstrap extends Yaf_Bootstrap_Abstract
{
    public function _initConfig(Yaf_Dispatcher $dispatcher)
    {
        $dispatcher->setDefaultModule("index")
            ->setDefaultController("admin")->setDefaultAction("login");
    }
}

/* index.php */
<?php
$config = array(
    "application" => array(
        "directory" => realpath(dirname(__FILE__)) . "/application/",
        "modules" => "Index,User,Admin",
    ),
);

$app = new Yaf_Application($config);
$app->bootstrap()->run();

/* /www/application/controllers/Admin.php */
<?php
class AdminController extends Yaf_Controller_Abstract
{
    public function loginAction()
    {
        echo "index::admin::login", PHP_EOL;
        return false;
    }
}

Expected result:
----------------
index::admin::login

Actual result:
--------------
index::admin::login
[Fri Apr 13 19:00:40 2018]  Script:  '/www/index.php'
/usr/local/php/php-7.2.4/Zend/zend_operators.c(2548) :  Freeing 0x000000010c604028 (6 bytes), script=/www/index.php
Last leak repeated 2 times
[Fri Apr 13 19:00:40 2018]  Script:  '/www/index.php'
/usr/local/php/include/php/Zend/zend_string.h(134) :  Freeing 0x000000010c66fb80 (32 bytes), script=/www/index.php
=== Total 4 memory leaks detected ===

Patches

yaf_dispatcher_setDefault.patch (last revision 2018-04-13 11:10 UTC by fanjiapeng at 126 dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-09-15 16:28 UTC] cmb@php.net
If this is still an issue, I suggest to submit a pull request[1]
for better visibility.

[1] <https://github.com/laruence/yaf/pulls>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 08:01:29 2024 UTC