php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56819 set_exception_handler looks to cause page fault with apd enabled
Submitted: 2006-02-03 11:26 UTC Modified: 2013-10-24 08:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: bugs at xmlnode dot com Assigned: yohgaki (profile)
Status: Closed Package: apd (PECL)
PHP Version: HEAD CVS-2006-02-03 OS: debian sarge (2.4.27-2-686-smp)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
15 - 6 = ?
Subscribe to this entry?

 
 [2006-02-03 11:26 UTC] bugs at xmlnode dot com
Description:
------------
if apd is enabled and set_exception_handler used (either against an object method or an inline function) a segmentation fault occurs.  If apd is commented out of php.ini it works as expected.  I believe the bug is similar to 4907, but different enough to warrant a separate bug.  If nothing else, mine contains a backtrace. :(

I've tried php 5.1.1, 5.1.2 and the latest dev build

Reproduce code:
---------------
<?php

function lastResort($e){
    echo mktime();
}

set_exception_handler('lastResort');
throw new Exception('doh');

?>

Expected result:
----------------
a unix timestamp

Actual result:
--------------
#0  0x0828e640 in zend_get_executed_lineno () at /usr/src/downloads/php-5.1.2/Zend/zend_execute_API.c:367
#1  0x4083003c in apd_execute (op_array=0x8692170) at /usr/src/downloads/apd-1.0.1/php_apd.c:515
#2  0x0828f449 in zend_call_function (fci=0xbfffd650, fci_cache=0x0) at /usr/src/downloads/php-5.1.2/Zend/zend_execute_API.c:907
#3  0x0828ecbe in call_user_function_ex (function_table=0x0, object_pp=0x0, function_name=0x0, retval_ptr_ptr=0x0, param_count=0, params=0x0, no_separation=0, symbol_table=0x0)
    at /usr/src/downloads/php-5.1.2/Zend/zend_execute_API.c:571
#4  0x082991c8 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/downloads/php-5.1.2/Zend/zend.c:1118
#5  0x0825fefd in php_execute_script (primary_file=0xbffffa80) at /usr/src/downloads/php-5.1.2/main/main.c:1720
#6  0x082fd5af in main (argc=2, argv=0xbffffb24) at /usr/src/downloads/php-5.1.2/sapi/cli/php_cli.c:1077

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-28 15:52 UTC] petr dot stastny at centrum dot cz
I have the same experience with PHP 5.2.5 and APD 1.0.1. Whenever I have my own exception handler, PHP crashes with segmentation fault when an exception is thrown.


function test_exception_handler($exc)
{
  echo $exc;
}

set_exception_handler('test_exception_handler');

throw new Exception('test');
 [2013-10-24 08:22 UTC] yohgaki@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: yohgaki
 [2013-10-24 08:22 UTC] yohgaki@php.net
APD is not maintained. Use xdebug.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 01:01:28 2019 UTC