Bug #61968 [Opn->Csd]: Crash in certain script using GD in Moodle
Edit report at https://bugs.php.net/bug.php?id=61968&edit=1
ID: 61968
User updated by: k-yamashita at ver2 dot jp
Reported by: k-yamashita at ver2 dot jp
Summary: Crash in certain script using GD in Moodle
-Status: Open
+Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: Windows 7 x86
PHP Version: 5.4.2
Block user comment: N
Private report: N
New Comment:
I don't experience this issue any more so I close it now.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2012-09-26 11:36:39] mihalych at vsepofigu dot ru
I've already wrote that it's not GD related.
------------------------------------------------------------------------
[2012-09-01 17:50:36] k-yamashita at ver2 dot jp
I'm sorry to report late. I tested the same script on PHP 5.4.6 and don't have any problem
now.
Thanks.
------------------------------------------------------------------------
[2012-09-01 11:25:23] pajoye@php.net
Don't see how it is related to GD, there is no trace of GD code in the backtrace.
------------------------------------------------------------------------
[2012-09-01 08:23:34] mihalych at vsepofigu dot ru
And now the same problem on FreeBSD 7.4-RELEASE-p9, PHP 5.3.16 with Suhosin-Patch
------------------------------------------------------------------------
[2012-06-26 14:31:30] mihalych at vsepofigu dot ru
Got the same issue with PHP 5.3.14 on openSUSE Tumbleweed. But it's not GD related.
Backtrace:
#0 zval_mark_grey (pz=<optimized out>) at /usr/src/debug/php-5.3.14/Zend/zend_gc.c:372
#1 0xb67c742d in gc_mark_roots () at /usr/src/debug/php-5.3.14/Zend/zend_gc.c:435
#2 gc_collect_cycles () at /usr/src/debug/php-5.3.14/Zend/zend_gc.c:664
#3 0xb67a63f5 in zend_deactivate () at /usr/src/debug/php-5.3.14/Zend/zend.c:901
#4 0xb6746aa9 in php_request_shutdown (dummy=0x0) at /usr/src/debug/php-5.3.14/main/main.c:1661
#5 0xb683ab44 in php_apache_request_dtor (r=<optimized out>) at
/usr/src/debug/php-5.3.14/sapi/apache2handler/sapi_apache2.c:509
#6 php_handler (r=0xb6f05058) at /usr/src/debug/php-5.3.14/sapi/apache2handler/sapi_apache2.c:681
Code which crashes:
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
class Plugin
{
private $name;
public function __construct()
{
$GLOBALS['app']->getFoo()->activePlugin = $this->name;
}
}
class Plugins
{
private $plugin;
public function init()
{
$this->plugin = new Plugin();
}
}
class LegacyApplication
{
private $plugins;
function init()
{
$this->plugins = new Plugins;
$this->plugins->init();
}
}
class Foo
{
public $activePlugin;
private $bar = array();
public function init()
{
$this->bar []= 'bar';
}
}
class Application
{
private $foo;
public function main()
{
$GLOBALS['LegacyObject'] = new LegacyApplication;
Application::getLegacyApplication()->init();
$this->foo = new Foo();
$this->foo->init();
}
public static function getLegacyApplication()
{
return $GLOBALS['LegacyObject'];
}
public function getFoo()
{
return $this->foo;
}
}
$app = new Application();
$app->main();
echo 'OK';
?>
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=61968
--
Edit this bug report at https://bugs.php.net/bug.php?id=61968&edit=1
Thread (7 messages)