php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46220 Writing something to a static var causes a crash instead of on error
Submitted: 2008-10-02 17:04 UTC Modified: 2008-10-18 17:54 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: typo3 at maltejansen dot de Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.3.0alpha2 OS: Windows XP SP2
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: typo3 at maltejansen dot de
New email:
PHP Version: OS:

 

 [2008-10-02 17:04 UTC] typo3 at maltejansen dot de
Description:
------------
(The crashes seem to be only on windows.)
Writing something to a static member var causes a crash instead of on error like "Don't write something into a static member var."

Seems to be relate to the comment:
http://de.php.net/manual/en/language.oop5.static.php#85277

Reproduce code:
---------------
The F3_Testing_Model_TestRunner is called by F3_Testing_TestRunnerWeb

http://forge.typo3.org/repositories/changes/package-testing/trunk/Classes/F3_Testing_TestRunnerWeb.php
http://forge.typo3.org/repositories/entry/package-testing/trunk/Classes/Model/F3_Testing_Model_TestRunner.php


Expected result:
----------------
An error message should be shown, that's not possible to write into static member var.

Actual result:
--------------
Apache crashes. (Xampp for Windows with PHP5.3alpha2)
If I removed the lines, writing into the static member var, in the constructor of F3::Testing::Model::TestRunner and the script is working.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-02 17:27 UTC] typo3 at maltejansen dot de
Ok, the it's not related to the comment. But it still crashes :(
 [2008-10-03 10:16 UTC] typo3 at maltejansen dot de
I just added some echo-output in each line of the construtor of F3::Testing::Model:TestRunner. An now I got no crash but Fatal Error. I have never seen such an message before and looks not like one from the FLOW3-Framework...


( ! ) Fatal error: Call to a member function getComponentManager() on a non-object in D:\workspace-flow3\htdocs\development\Packages\Testing\Classes\Model\F3_Testing_Model_TestRunner.php on line 0
Call Stack
#	Time	Memory	Function	Location
1	0.0007	337536	{main}( )	..\index.php:0
2	0.0251	590568	F3::FLOW3->run( )	..\index.php:30
3	37.2597	31130128	F3::FLOW3::MVC::Web::RequestHandler->handleRequest( )	..\F3_FLOW3.php:443
4	37.3568	31149368	F3::FLOW3::MVC::Dispatcher->dispatch( )	..\F3_FLOW3_MVC_Web_RequestHandler.php:85
5	37.3571	31149368	F3::FLOW3::MVC::Dispatcher->getPreparedController( )	..\F3_FLOW3_MVC_Dispatcher.php:123
6	37.3576	31149728	F3::FLOW3::Component::Factory->getComponent( )	..\F3_FLOW3_MVC_Dispatcher.php:141
7	37.3576	31149728	F3::FLOW3::Component::ObjectBuilder->createComponentObject( )	..\F3_FLOW3_Component_Factory.php:121
8	37.3656	31161256	F3::FLOW3::Component::ObjectBuilder->injectSetterProperties( )	..\F3_FLOW3_Component_ObjectBuilder.php:110
9	37.3656	31161256	F3::FLOW3::Component::Factory->getComponent( )	..\F3_FLOW3_Component_ObjectBuilder.php:271
10	37.3657	31161256	F3::FLOW3::Component::ObjectBuilder->createComponentObject( )	..\F3_FLOW3_Component_Factory.php:115
11	37.3669	31161408	ReflectionClass->newInstanceArgs( )	..\F3_FLOW3_Component_ObjectBuilder.php:103
12	37.3670	31161480	F3::Testing::AbstractTestRunner->__construct( )	..\F3_Testing_AbstractTestRunner.php:0
13	37.3670	31161480	F3::FLOW3::Component::Factory->getComponent( )	..\F3_Testing_AbstractTestRunner.php:87
14	37.3671	31161624	F3::FLOW3::Component::ObjectBuilder->createComponentObject( )	..\F3_FLOW3_Component_Factory.php:121
15	38.4300	31354576	ReflectionClass->newInstanceArgs( )	..\F3_FLOW3_Component_ObjectBuilder.php:103
16	38.4300	31354576	F3::Testing::Model::TestRunner->__construct( )	..\F3_Testing_Model_TestRunner.php:0

( ! ) Fatal error: Exception thrown without a stack frame in Unknown on line 0
Call Stack
#	Time	Memory	Function	Location
1	0.0007	337536	{main}( )	..\index.php:0
2	0.0251	590568	F3::FLOW3->run( )	..\index.php:30
3	37.2597	31130128	F3::FLOW3::MVC::Web::RequestHandler->handleRequest( )	..\F3_FLOW3.php:443
4	37.3568	31149368	F3::FLOW3::MVC::Dispatcher->dispatch( )	..\F3_FLOW3_MVC_Web_RequestHandler.php:85
5	37.3571	31149368	F3::FLOW3::MVC::Dispatcher->getPreparedController( )	..\F3_FLOW3_MVC_Dispatcher.php:123
6	37.3576	31149728	F3::FLOW3::Component::Factory->getComponent( )	..\F3_FLOW3_MVC_Dispatcher.php:141
7	37.3576	31149728	F3::FLOW3::Component::ObjectBuilder->createComponentObject( )	..\F3_FLOW3_Component_Factory.php:121
8	37.3656	31161256	F3::FLOW3::Component::ObjectBuilder->injectSetterProperties( )	..\F3_FLOW3_Component_ObjectBuilder.php:110
9	37.3656	31161256	F3::FLOW3::Component::Factory->getComponent( )	..\F3_FLOW3_Component_ObjectBuilder.php:271
10	37.3657	31161256	F3::FLOW3::Component::ObjectBuilder->createComponentObject( )	..\F3_FLOW3_Component_Factory.php:115
11	37.3669	31161408	ReflectionClass->newInstanceArgs( )	..\F3_FLOW3_Component_ObjectBuilder.php:103
12	37.3670	31161480	F3::Testing::AbstractTestRunner->__construct( )	..\F3_Testing_AbstractTestRunner.php:0
13	37.3670	31161480	F3::FLOW3::Component::Factory->getComponent( )	..\F3_Testing_AbstractTestRunner.php:87
14	37.3671	31161624	F3::FLOW3::Component::ObjectBuilder->createComponentObject( )	..\F3_FLOW3_Component_Factory.php:121
15	38.4300	31354576	ReflectionClass->newInstanceArgs( )	..\F3_FLOW3_Component_ObjectBuilder.php:103
16	38.4300	31354576	F3::Testing::Model::TestRunner->__construct( )	..\F3_Testing_Model_TestRunner.php:0

---

Next I will test the latest SnapShot...
 [2008-10-03 21:38 UTC] typo3 at maltejansen dot de
Hi,
I have just tested the latest SnapShot and there is no other result.
But i have added a simple FileLogger to the class  F3::Testing::Model::TestRunner (constructor) :

$log->log('$FLOW3->initializeFLOW3()', 1, NULL, 'Testing', __CLASS__);
---> $FLOW3->initializeFLOW3(); <---
$log->log('$componentManager', 1, NULL, 'Testing', __CLASS__);
self::$componentManager = $FLOW3->getComponentManager();		self::$componentManager->unregisterComponent('F3::FLOW3::Session::SessionInterface');		self::$componentManager->registerComponent('F3::FLOW3::Session::SessionInterface', 'F3::FLOW3::Session::Transient');

And it's not the static part, but the line above. Although it's crashing, the FileLogger still write logs to the file after "$FLOW3->initializeFLOW3();"
(The FLOW-Framework is initializied twice. Once for the framework itself and once for the testing framework.) After talking to the one of the chef-programmers, it's seems to be only on windows plattforms. They are using Linux.

By the way, the Logging of PHP says:
[some time] [notice] Parent: child process exited with status 0 -- Restarting.
...
 [2008-10-04 21:45 UTC] typo3 at maltejansen dot de
Hi,
a friend just send me his XAMPP with PHP5.3alpha2-dev (Build Aug 5 2008 17:46:53). It's running pretty well.
If I replace his version with the one from yesterday, it's crashing again.
 [2008-10-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Apr 12 06:01:28 2025 UTC