|  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
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
 [2006-02-03 11:26 UTC] bugs at xmlnode dot com
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:

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

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


Add a Patch

Pull Requests

Add a Pull Request


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;


throw new Exception('test');
 [2013-10-24 08:22 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: yohgaki
 [2013-10-24 08:22 UTC]
APD is not maintained. Use xdebug.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 02:05:54 2022 UTC