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
Hello,
I've been running into a strange segfault with PHP 5.2.x (it works in
PHP 5.3) when usingcall_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.
I didn't test it as I have no 5.2 right now at hand on this box but I
think call_user_func messes with references in parameters to the called
function. In 5.3 this is fixed by zend_parse_parameters. I saw some code
(Serendipity's way of using Smarty) break with 5.3 since reference
handling changed there, didn't investigate but 5.3 seemed to be correct
on first sight.
Not sure if that's enough of an pointer to help debugging that issue...
johannes