#32981 [Fbk->Opn]: ReflectionMethod::getStaticVariables() causes apache2.0.54 seg fault
| From: | phpbug at swift-web dot com | Date: | Mon, 09 May 2005 20:19:10 +0000 |
| Subject: | #32981 [Fbk->Opn]: ReflectionMethod::getStaticVariables() causes apache2.0.54 seg fault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-78821@lists.php.net to get a copy of this message | ||
ID: 32981
User updated by: phpbug at swift-web dot com
Reported By: phpbug at swift-web dot com
-Status: Feedback
+Status: Open
Bug Type: Reproducible crash
Operating System: Gentoo 2.6.11
-PHP Version: 5.0.4
+PHP Version: 5.0.5-dev
New Comment:
Tried with the latest stable 5.0 (from the link you sent) and the page
still crashes with seg fault error.
The version reported in phpinfo is 5.0.5-dev from that install.
Previous Comments:
------------------------------------------------------------------------
[2005-05-09 11:36:40] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
Seems to work fine fore me with latest CVS HEAD (5.1-dev) but do try
and see if it's fixed in the 5.0 too.
------------------------------------------------------------------------
[2005-05-09 10:15:43] phpbug at swift-web dot com
Description:
------------
Discovered if I am using ReflectionMethod::getStaticVariables() on a
method that has a static variable that is set to boolean true or false
then php crashes (Apache 2 exists with following error)
[notice] child pid 28346 exit signal Segmentation fault (11)
I tried with php version 5.0.3 initially but upgraded to 5.0.4 and
problem still exists.
Reproduce code:
---------------
class demo_class {
static function myDemo($toggle) {
static $enabled = true;
// do whatever
}
}
$class = new ReflectionClass('demo_class');
foreach ($class->getMethods() as $method) {
$arr_static_vars[] = $method->getStaticVariables();
}
echo "done";
// (normally would output $arr_static_var but just put above
// line for simplicity in this example)
Expected result:
----------------
See a screen with just the word 'done' on it
Actual result:
--------------
Page loading stops immediately (and keeps last page shown displayed.
Apache logs show:
[notice] child pid 28346 exit signal Segmentation fault (11)
(pid of course varies)
If I change the third line in my sample code to:
static $enabled = 1;
(or string) the page does not crash and things display properly
I haven't tested this to see if it also crashes showing static
variables for the entire class (as opposed to the one in the method)
but if they inherit the same code I guess it would also crash but again
I haven't confirmed that.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32981&edit=1