php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49142 crash when exception thrown from __tostring() (PHP_5_3 only!)
Submitted: 2009-08-03 16:01 UTC Modified: 2009-10-27 22:05 UTC
From: ies_clan at hotmail dot com Assigned: dsp (profile)
Status: Closed Package: Reproducible crash
PHP Version: 5.3 (2009-08-04) OS: *
Private report: No CVE-ID: None
 [2009-08-03 16:01 UTC] ies_clan at hotmail dot com
Description:
------------
plz first load the zip and install the script:
http://www.immunecellcompetence.com/exceptionBug.zip

in the root dir is a sql file.
u have to edit the exceptionBug\Engine\Configuration\Password.Inc.php
file.

after that, u can start it.

if u see the login page, klick on the link: Login mit EnemyArea und test

sometimes often, until u got loged in. then klick on the next link: EnemyArea

and the apache will crash with the following msg: unbehandelte ausnahme in httpd.exe [4624]

to fix it you have to go into the MKLF\System\Engine\StyleSheet.class.php

the line //use MKLF\System\Engine\Exceptions\SystemException; is the problem.

if u comment that in, it will work.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-03 22:27 UTC] jani@php.net
Reduced reproduce script:

<?php

class AScript
{
    public static function CreateFiles()
    {
        file_put_contents('temp.txt', new self);
    }

    public function __toString()
    {
        throw new Exception('Server Crash!');
    }
}

function foo() { return true; }

set_error_handler('foo');
session_set_save_handler( 'foo', 'foo', 'foo', 'foo', 'foo', 'foo' );
session_start();

AScript::CreateFiles();


 [2009-08-03 22:27 UTC] jani@php.net
Program received signal SIGSEGV, Segmentation fault.
zend_hash_num_elements (ht=0x8e05b50) at /home/jani/src/php-
5.3/Zend/zend_hash.c:1014
1014    {
(gdb) bt
#0  zend_hash_num_elements (ht=0x8e05b50) at /home/jani/src/php-
5.3/Zend/zend_hash.c:1014
#1  0x082a3a00 in zend_error (type=148921168, format=0x8716124 "%s") 
at /home/jani/src/php-5.3/Zend/zend_variables.h:45
#2  0x08254a7a in php_verror (docref=0x0, params=0x83723ec "", type=2,
    format=0x86eb0dc "Failed to write session data (%s). Please verify 
that the current setting of session.save_path is correct (%s)",
    args=0xbfe5ed9c "3\204n\b&#65533;#7\b\"") at /home/jani/src/php-
5.3/main/main.c:794
#3  0x08254f51 in php_error_docref0 (docref=0x0, type=2,
    format=0x86eb0dc "Failed to write session data (%s). Please verify 
that the current setting of session.save_path is correct (%s)")
    at /home/jani/src/php-5.3/main/main.c:806
#4  0x0817fff5 in php_session_flush () at /home/jani/src/php-
5.3/ext/session/session.c:598
#5  0x08180281 in zm_deactivate_session (type=1, module_number=22) at 
/home/jani/src/php-5.3/ext/session/session.c:2138
#6  0x082a4310 in module_registry_cleanup (module=0x8ceb6e8) at 
/home/jani/src/php-5.3/Zend/zend_API.c:2150
#7  0x082adb84 in zend_hash_reverse_apply (ht=0x8757600, 
apply_func=0x82a42f0 <module_registry_cleanup>)
    at /home/jani/src/php-5.3/Zend/zend_hash.c:755
#8  0x082a2a19 in zend_deactivate_modules () at /home/jani/src/php-
5.3/Zend/zend.c:866
#9  0x0825360a in php_request_shutdown (dummy=0x0) at 
/home/jani/src/php-5.3/main/main.c:1565
#10 0x08321224 in main (argc=3, argv=0xbfe5f374) at 
/home/jani/src/php-5.3/sapi/cli/php_cli.c:1369

 [2009-10-27 13:02 UTC] svn@php.net
Automatic comment from SVN on behalf of dsp
Revision: http://svn.php.net/viewvc/?view=revision&revision=289987
Log: - Fixed bug #49142 (crash when exception thrown from __tostring())
 [2009-10-28 11:08 UTC] svn@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=290026
Log: - Merge revision 289987, Fixed bug #49142 (crash when exception thrown from __tostring())
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 10:01:30 2024 UTC