php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72458 Crash in call_user_function_ex when callback target object has a constant
Submitted: 2016-06-20 11:13 UTC Modified: 2016-06-22 08:18 UTC
From: emilkm at gmail dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 7.0.8RC1 OS: Windows
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:
46 - 41 = ?
Subscribe to this entry?

 
 [2016-06-20 11:13 UTC] emilkm at gmail dot com
Description:
------------
I am working on upgrading a custom extension to PHP 7. 

I struck a problem while using call_user_function_ex to call a target object method
- when that object has a constant defined 
- and I pass parameters to the callback

The call completes successfully if I comment out the constant, or do not pass any parameters.

Tried in 7.0.6, 7.0.7, and 7.0.8RC1.

Crash occurs in zend_llist_apply_with_argument

Test script:
---------------
https://github.com/emilkm/aext

Expected result:
----------------
PHP code runs a custom extension function, the extension calls back the PHP method successfully passing two parameters.

Actual result:
--------------
 	dbg-php-7.0.dll!00007ffbeb3c129f()	Unknown
 	dbg-php-7.0.dll!00007ffbeb3c15a5()	Unknown
 	dbg-php-7.0.dll!00007ffbeb3c1e2a()	Unknown
>	php7.dll!zend_llist_apply_with_argument(_zend_llist * l, void(*)(void *, void *) func, void * arg) Line 236	C
 	dbg-php-7.0.dll!00007ffbeb3c37a4()	Unknown
 	dbg-php-7.0.dll!00007ffbeb3bc07e()	Unknown
 	dbg-php-7.0.dll!00007ffbeb3b8f99()	Unknown
 	dbg-php-7.0.dll!00007ffbeb3b916e()	Unknown
 	php7.dll!zend_extension_statement_handler(const _zend_extension * extension, _zend_op_array * op_array) Line 1491	C
 	php7.dll!zend_llist_apply_with_argument(_zend_llist * l, void(*)(void *, void *) func, void * arg) Line 236	C
 	php7.dll!ZEND_EXT_STMT_SPEC_HANDLER(_zend_execute_data * execute_data) Line 1301	C
 	php7.dll!execute_ex(_zend_execute_data * ex) Line 417	C
 	dbg-php-7.0.dll!00007ffbeb3b6dce()	Unknown
 	php7.dll!ZEND_DO_FCALL_SPEC_HANDLER(_zend_execute_data * execute_data) Line 802	C
 	php7.dll!execute_ex(_zend_execute_data * ex) Line 417	C
 	dbg-php-7.0.dll!00007ffbeb3b6dce()	Unknown
 	php7.dll!zend_execute(_zend_op_array * op_array, _zval_struct * return_value) Line 459	C
 	php7.dll!zend_execute_scripts(int type, _zval_struct * retval, int file_count, ...) Line 1428	C
 	php7.dll!php_execute_script(_zend_file_handle * primary_file) Line 2494	C
 	php.exe!do_cli(int argc, char * * argv) Line 975	C
 	php.exe!main(int argc, char * * argv) Line 1344	C
 	php.exe!__scrt_common_main_seh() Line 264	C++
 	kernel32.dll!00007ffc091e8102()	Unknown
 	ntdll.dll!00007ffc09e5c5b4()	Unknown

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-21 00:37 UTC] oldbucsfan at hotmail dot com
Related to but 72359? https://bugs.php.net/bug.php?id=72359
 [2016-06-22 04:56 UTC] emilkm at gmail dot com
Confirmed it works as expected on Linux. Tested on Fedora 23.
 [2016-06-22 08:18 UTC] emilkm at gmail dot com
-Status: Open +Status: Closed
 [2016-06-22 08:18 UTC] emilkm at gmail dot com
Sincere apologies, I am pleased to say that was a false alarm. 

I was running the PHP script through NuSphere PHP DBG. Crash occurs only while debugging the PHP script.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC