Bug #62225 [Opn->Fbk]: apache segfault with function named init()
| From: | laruence@php.net | Date: | Tue, 05 Jun 2012 02:18:54 +0000 |
| Subject: | Bug #62225 [Opn->Fbk]: apache segfault with function named init() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-171032@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62225&edit=1
ID: 62225
Updated by: laruence@php.net
Reported by: ehymel at e-medico dot com
Summary: apache segfault with function named init()
-Status: Open
+Status: Feedback
Type: Bug
Package: Class/Object related
Operating System: Fedora 17
PHP Version: 5.4.3
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2012-06-04 18:03:28] 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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62225&edit=1