call_user_func segfault
| From: | Derick Rethans | Date: | Fri, 02 Jan 2009 15:55:41 +0000 |
| Subject: | call_user_func segfault | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-42448@lists.php.net to get a copy of this message | ||
Hello,
I've been running into a strange segfault with PHP 5.2.x (it works in
PHP 5.3) when using call_user_func() recursively. I can not find out
what causes it, but I did manage to have a simple test case. For the
test to crash, you either need a debug build of PHP, or valgrind +
USE_ZEND_ALLOC=0. You need run the script from within the "test"
directory as it assumes file system layout.
There is luckily a simple work around for the bug, by replacing:
call_user_func( $callback, $callbackContext, $sourceDir, $entry, 42 );
with
call_user_func_array( $callback, array( $callbackContext, $sourceDir, $entry, 42 ) );
I uploaded the test case as a .tar archive to
http://files.derickrethans.nl/test.tar.gz
It'd be ace if you could have a look at it (before I file a bug report).
regards,
Derick
--
HEAD before 5_3!: http://tinyurl.com/6d2esb
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org