php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27186 Uncaught exception causes segfault when extending the Exception class.
Submitted: 2004-02-08 18:10 UTC Modified: 2004-02-10 11:01 UTC
From: tress at b0g dot org Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.0b3 (beta3) OS: FreeBSD 4.9-STABLE
Private report: No CVE-ID: None
 [2004-02-08 18:10 UTC] tress at b0g dot org
Description:
------------
Uncaught exception causes segfault when extending the Exception class and $msg is an integer.

Reproduce code:
---------------
<?php
class test
{
function __construct()
{                                                          
throw new err(1);              
}                                   
}                                   
                                  
class err extends Exception         
{                                   
function __construct($msg)          
{
//parent::Exception(); // Fatal error: Call to undefined method exception::exception() in test.php                             
$this->message=$msg;                
}                                   
}                                   

$t=new test;
?>

Expected result:
----------------
Fatal error: Uncaught exception 'err' with message '1' in test.php:8 Stack trace: #0 test.php(): test->__construct() #1 {main} thrown in test.php


Actual result:
--------------
#0  0x28333164 in zif_reflection_extension_getName (ht=135174572, return_value=0x0, 
    this_ptr=0xbfbffa30, return_value_used=134639035)
    at /usr/local/php5/Zend/zend_reflection_api.c:2861
#1  0x8066deb in ap_clear_pool ()
#2  0x8066e6b in ap_destroy_pool ()
#3  0x8066dd7 in ap_clear_pool ()
#4  0x8066e6b in ap_destroy_pool ()
#5  0x8075c00 in clean_parent_exit ()
#6  0x807898f in standalone_main ()
#7  0x8078ee0 in main ()
#8  0x804ef62 in _start ()

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-09 11:48 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Same backtrace (with latest CVS) as with #26698

 [2004-02-10 11:01 UTC] zeev@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Doesn't appear to be the same as #26698 after all.  It's fixed anyway.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Oct 16 19:00:01 2025 UTC