php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62225 apache segfault with function named init()
Submitted: 2012-06-04 18:03 UTC Modified: 2013-02-18 00:35 UTC
From: ehymel at e-medico dot com Assigned:
Status: No Feedback Package: Class/Object related
PHP Version: 5.4.3 OS: Fedora 17
Private report: No CVE-ID: None
 [2012-06-04 18:03 UTC] ehymel at e-medico dot com
Description:
------------
I have been using a set of scripts and classes for about a year without problem 
until recent upgrade from Fedora 16 to 17, which brought with it PHP 5.4.3. I 
started seeing segfaults in apache and I eventually narrowed the problem to the 
use of the function name 'init()'. See the code below.

After some experimentation, I found that by simply renaming the init() function to 
something else, like initialize(), then all works fine.

fwiw, I do not have ZendFramework installed (I believe that framework uses init() 
function quite a bit).

Test script:
---------------
//DOES NOT WORK:
class Foo {
    function __construct() {
        // construction functions
        $this->init();
    }
    
    function init() {    
        // init functions;
    }
}


//WORKS:
class Bar{
    function __construct() {
        // construction functions
        $this->initialize();
    }
    
    function initialize() {    
        // init functions;
    }
}

Expected result:
----------------
No segfault.

Actual result:
--------------
Segfault.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-05 02:18 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2012-06-05 02:18 UTC] laruence@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
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 "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC