Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault when adding custom function to Volt #2939

Closed
michalderlatka opened this issue Oct 24, 2014 · 2 comments
Closed

Segfault when adding custom function to Volt #2939

michalderlatka opened this issue Oct 24, 2014 · 2 comments

Comments

@michalderlatka
Copy link

I'm using Phalcon 1.3.3 on Nginx, PHP 5.5.17 with Xdebug 2.2.5. When using custom function in Volt's template, php-fpm crashes. It seems this problem is related with xdebug, because after disabling xdebug extension, fpm is not crashing anymore.

in bootstrap file:

$volt->getCompiler()->addFunction('_', function ($resolvedArgs, $exprArgs) use ($di) {
return sprintf('('%s')', $exprArgs[0]['expr']['value']);
});

template:

{{ _("Test") }}

gdb:

Program terminated with signal 11, Segmentation fault.
#0 0x00007f641db97f7a in xdebug_add_stack_frame () from /usr/lib/php5/20121212/xdebug.so

(gdb) bt
#0 0x00007f641db97f7a in xdebug_add_stack_frame () from /usr/lib/php5/20121212/xdebug.so
#1 0x00007f641db87608 in xdebug_execute_internal () from /usr/lib/php5/20121212/xdebug.so
#2 0x00000000006c12fe in zend_call_function (fci=0x7fff72cce480, fci_cache=0x7fff72cce320) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_execute_API.c:957
#3 0x00007f6416fdd341 in phalcon_call_user_function () from /usr/lib/php5/20121212/phalcon.so
#4 0x00007f64170495b2 in phalcon_return_call_function () from /usr/lib/php5/20121212/phalcon.so
#5 0x00007f6417100df6 in zim_Phalcon_Mvc_View_Engine_Volt_Compiler_functionCall () from /usr/lib/php5/20121212/phalcon.so
#6 0x00000000006befc9 in dtrace_execute_internal (execute_data_ptr=, fci=, return_value_used=)

at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_dtrace.c:97

#7 0x00007f641db876ba in xdebug_execute_internal () from /usr/lib/php5/20121212/xdebug.so
#8 0x00000000006c12fe in zend_call_function (fci=0x7fff72ccea30, fci_cache=0x7fff72cce8d0) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_execute_API.c:957
#9 0x00007f6416fdd341 in phalcon_call_user_function () from /usr/lib/php5/20121212/phalcon.so
#10 0x00007f6416fdde12 in phalcon_call_class_method_aparams () from /usr/lib/php5/20121212/phalcon.so
#11 0x00007f6417197d53 in zim_Phalcon_Mvc_View_Engine_Volt_Compiler_expression () from /usr/lib/php5/20121212/phalcon.so
#12 0x00000000006befc9 in dtrace_execute_internal (execute_data_ptr=, fci=, return_value_used=)

at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_dtrace.c:97

#13 0x00007f641db876ba in xdebug_execute_internal () from /usr/lib/php5/20121212/xdebug.so
#14 0x00000000006c12fe in zend_call_function (fci=0x7fff72ccf020, fci_cache=0x7fff72cceec0) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_execute_API.c:957
#15 0x00007f6416fdd341 in phalcon_call_user_function () from /usr/lib/php5/20121212/phalcon.so
#16 0x00007f6416fdde12 in phalcon_call_class_method_aparams () from /usr/lib/php5/20121212/phalcon.so
#17 0x00007f64171795f8 in zim_Phalcon_Mvc_View_Engine_Volt_Compiler_compileEcho () from /usr/lib/php5/20121212/phalcon.so
#18 0x00000000006befc9 in dtrace_execute_internal (execute_data_ptr=, fci=, return_value_used=)

at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_dtrace.c:97

#19 0x00007f641db876ba in xdebug_execute_internal () from /usr/lib/php5/20121212/xdebug.so
#20 0x00000000006c12fe in zend_call_function (fci=0x7fff72ccf550, fci_cache=0x7fff72ccf3f0) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_execute_API.c:957
#21 0x00007f6416fdd341 in phalcon_call_user_function () from /usr/lib/php5/20121212/phalcon.so
#22 0x00007f6416fdde12 in phalcon_call_class_method_aparams () from /usr/lib/php5/20121212/phalcon.so
#23 0x00007f641715d148 in zim_Phalcon_Mvc_View_Engine_Volt_Compiler__statementList () from /usr/lib/php5/20121212/phalcon.so
#24 0x00000000006befc9 in dtrace_execute_internal (execute_data_ptr=, fci=, return_value_used=)

at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_dtrace.c:97

#25 0x00007f641db876ba in xdebug_execute_internal () from /usr/lib/php5/20121212/xdebug.so
#26 0x00000000006c12fe in zend_call_function (fci=0x7fff72ccfb40, fci_cache=0x7fff72ccf9e0) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_execute_API.c:957
#27 0x00007f6416fdd341 in phalcon_call_user_function () from /usr/lib/php5/20121212/phalcon.so
#28 0x00007f6416fdde12 in phalcon_call_class_method_aparams () from /usr/lib/php5/20121212/phalcon.so
#29 0x00007f64171267d3 in zim_Phalcon_Mvc_View_Engine_Volt_Compiler__compileSource () from /usr/lib/php5/20121212/phalcon.so
#30 0x00000000006befc9 in dtrace_execute_internal (execute_data_ptr=, fci=, return_value_used=)

at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_dtrace.c:97

#31 0x00007f641db876ba in xdebug_execute_internal () from /usr/lib/php5/20121212/xdebug.so
#32 0x00000000006c12fe in zend_call_function (fci=0x7fff72cd0080, fci_cache=0x7fff72ccff20) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_execute_API.c:957
#33 0x00007f6416fdd341 in phalcon_call_user_function () from /usr/lib/php5/20121212/phalcon.so
#34 0x00007f6416fdde12 in phalcon_call_class_method_aparams () from /usr/lib/php5/20121212/phalcon.so
#35 0x00007f6417037bc4 in zim_Phalcon_Mvc_View_Engine_Volt_Compiler_compileFile () from /usr/lib/php5/20121212/phalcon.so
#36 0x00000000006befc9 in dtrace_execute_internal (execute_data_ptr=, fci=, return_value_used=)

at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_dtrace.c:97

#37 0x00007f641db876ba in xdebug_execute_internal () from /usr/lib/php5/20121212/xdebug.so
#38 0x00000000006c12fe in zend_call_function (fci=0x7fff72cd05b0, fci_cache=0x7fff72cd0450) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_execute_API.c:957
#39 0x00007f6416fdd341 in phalcon_call_user_function () from /usr/lib/php5/20121212/phalcon.so
#40 0x00007f6416fdde12 in phalcon_call_class_method_aparams () from /usr/lib/php5/20121212/phalcon.so
#41 0x00007f64171182a8 in zim_Phalcon_Mvc_View_Engine_Volt_Compiler_compile () from /usr/lib/php5/20121212/phalcon.so
#42 0x00000000006befc9 in dtrace_execute_internal (execute_data_ptr=, fci=, return_value_used=)

at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_dtrace.c:97

#43 0x00007f641db876ba in xdebug_execute_internal () from /usr/lib/php5/20121212/xdebug.so
#44 0x00000000006c12fe in zend_call_function (fci=0x7fff72cd0c40, fci_cache=0x7fff72cd0ae0) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_execute_API.c:957
#45 0x00007f6416fdd341 in phalcon_call_user_function () from /usr/lib/php5/20121212/phalcon.so
#46 0x00007f6416fdde12 in phalcon_call_class_method_aparams () from /usr/lib/php5/20121212/phalcon.so
#47 0x00007f64170a7cdb in zim_Phalcon_Mvc_View_Engine_Volt_render () from /usr/lib/php5/20121212/phalcon.so
#48 0x00000000006befc9 in dtrace_execute_internal (execute_data_ptr=, fci=, return_value_used=)

at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_dtrace.c:97

#49 0x00007f641db876ba in xdebug_execute_internal () from /usr/lib/php5/20121212/xdebug.so
#50 0x00000000006c12fe in zend_call_function (fci=0x7fff72cd1140, fci_cache=0x7fff72cd0fe0) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_execute_API.c:957
#51 0x00007f6416fdd341 in phalcon_call_user_function () from /usr/lib/php5/20121212/phalcon.so
#52 0x00007f6416fdde12 in phalcon_call_class_method_aparams () from /usr/lib/php5/20121212/phalcon.so
#53 0x00007f64171505e3 in zim_Phalcon_Mvc_View__engineRender () from /usr/lib/php5/20121212/phalcon.so
#54 0x00000000006befc9 in dtrace_execute_internal (execute_data_ptr=, fci=, return_value_used=)

---Type to continue, or q to quit---
at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_dtrace.c:97
#55 0x00007f641db876ba in xdebug_execute_internal () from /usr/lib/php5/20121212/xdebug.so
#56 0x00000000006c12fe in zend_call_function (fci=0x7fff72cd1750, fci_cache=0x7fff72cd15f0) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_execute_API.c:957
#57 0x00007f6416fdd341 in phalcon_call_user_function () from /usr/lib/php5/20121212/phalcon.so
#58 0x00007f6416fdde12 in phalcon_call_class_method_aparams () from /usr/lib/php5/20121212/phalcon.so
#59 0x00007f641711c08f in zim_Phalcon_Mvc_View_render () from /usr/lib/php5/20121212/phalcon.so
#60 0x00000000006befc9 in dtrace_execute_internal (execute_data_ptr=, fci=, return_value_used=)

at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_dtrace.c:97

#61 0x00007f641db876ba in xdebug_execute_internal () from /usr/lib/php5/20121212/xdebug.so
#62 0x00000000006c12fe in zend_call_function (fci=0x7fff72cd1e70, fci_cache=0x7fff72cd1d10) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_execute_API.c:957
#63 0x00007f6416fdd341 in phalcon_call_user_function () from /usr/lib/php5/20121212/phalcon.so
#64 0x00007f6416fdde12 in phalcon_call_class_method_aparams () from /usr/lib/php5/20121212/phalcon.so
#65 0x00007f641717c3e6 in zim_Phalcon_Mvc_Application_handle () from /usr/lib/php5/20121212/phalcon.so
#66 0x00000000006befc9 in dtrace_execute_internal (execute_data_ptr=, fci=, return_value_used=)

at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_dtrace.c:97

#67 0x00007f641db876ba in xdebug_execute_internal () from /usr/lib/php5/20121212/xdebug.so
#68 0x000000000077e5cb in zend_do_fcall_common_helper_SPEC (execute_data=0x7f6421c5a5c0) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_vm_execute.h:552
#69 0x000000000073e6d8 in execute_ex (execute_data=0x7f6421c5a5c0) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_vm_execute.h:363
#70 0x00000000006bee9d in dtrace_execute_ex (execute_data=) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend_dtrace.c:73
#71 0x00007f641db87c8c in xdebug_execute_ex () from /usr/lib/php5/20121212/xdebug.so
#72 0x00000000006d0b39 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /usr/src/php5.5/source/dotdeb-php5/Zend/zend.c:1330
#73 0x000000000066e99c in php_execute_script (primary_file=primary_file@entry=0x7fff72cd4980) at /usr/src/php5.5/source/dotdeb-php5/main/main.c:2506
#74 0x0000000000432d62 in main (argc=, argv=) at /usr/src/php5.5/source/dotdeb-php5/sapi/fpm/fpm/fpm_main.c:1938

@phalcon
Copy link
Collaborator

phalcon commented Oct 24, 2014

This is caused because of Xdebug

@oh-ren
Copy link

oh-ren commented Oct 28, 2014

See #2269

@phalcon phalcon closed this as completed Nov 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants