#50005 [Ver]: Throwing through Reflection modified Exception object makes segmentation fault

From: Date: Thu, 05 Nov 2009 14:50:00 +0000
Subject: #50005 [Ver]: Throwing through Reflection modified Exception object makes segmentation fault
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-144293@lists.php.net to get a copy of this message
 ID:               50005
 Updated by:       kalle@php.net
 Reported By:      arturas dot moskvinas at gmail dot com
 Status:           Verified
 Bug Type:         Reproducible crash
 Operating System: Centos 5.3 Final 64bit
 PHP Version:      5.3.0
 New Comment:

I cannot reproduce this using VC9 TS builds on Windows, using 5.3.0 and
5.3.2-dev:

C:\php>php -v
PHP 5.3.2-dev (cli) (built: Nov  5 2009 15:19:54)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

C:\php>php bug50005.php

Fatal error: Uncaught exception 'Exception' in :2
Stack trace:
#0 {main}
  thrown in (null) on line 2



Previous Comments:
------------------------------------------------------------------------

[2009-10-26 22:22:53] johannes@php.net

(dbx) where 
current thread: t@1
  [1] strlen(0x0, 0x0, 0x44, 0xfefefefefefefeff, 0x0, 0x4000), at
0xfffffd7fff18d520 
  [2] strdup(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff1ccf78 
  [3] php_error_cb(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0x894252 
=>[4] zend_error_va(type = 1, file = (nil), lineno = 2U, format =
0xcf5f12 "Uncaught %s\n  thrown", ...), line 749 in "zend_exceptions.c"
  [5] zend_exception_error(exception = 0xd6a890, severity = 1), line
789 in "zend_exceptions.c"
  [6] zend_execute_scripts(type = 8, retval = (nil), file_count = 3,
...), line 1212 in "zend.c"
  [7] php_execute_script(primary_file = 0xfffffd7fffdff780), line 2226
in "main.c"
  [8] main(argc = 1, argv = 0xfffffd7fffdff858), line 1190 in
"php_cli.c"


------------------------------------------------------------------------

[2009-10-26 21:23:39] arturas dot moskvinas at gmail dot com

Description:
------------
Throwing through Reflection modified Exception (or any other Exception
type) object makes php segment fault when file property is set to null.



Reproduce code:
---------------
<?php
$e = new Exception();
$reflection = new ReflectionObject($e);
$property = $reflection->getProperty("file");
$property->setAccessible(true);
$property->setValue($e, null);
throw $e;
?>

Expected result:
----------------
PHP Fatal error:  Uncaught exception 'Exception' in null:xx

Actual result:
--------------
Segmentation fault


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50005&edit=1



Thread (5 messages)

« previous php.bugs (#144293) next »