cphalcon: Segfaults on user level (syntax) errors

Expected and Actual Behavior

PHP fatal/syntax error.

Describe what you are trying to achieve and what goes wrong.

From any controller, trying to call simple facade method defined in ControllerBase or wherever, making a mistake which should cause only syntax error. Instead, nginx throws 502 Bad Gateway HTTP response, while PHP-FPM throws: [480094.083490] php-fpm7.0[30488]: segfault at 1c ip 00005563990e8d28 sp 00007ffdf56be410 error 4 in php-fpm7.0[556398e93000+3a9000]

Backtrace:

Core was generated by `php-fpm: pool middleware-php7                                                '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00005563990e8d28 in _object_and_properties_init ()
(gdb) bt
#0  0x00005563990e8d28 in _object_and_properties_init ()
#1  0x00007f53984f47f7 in zim_Phalcon_Mvc_Micro_LazyLoader___call () from /usr/lib/php/20151012/phalcon.so
#2  0x00005563990d62fa in dtrace_execute_internal ()
#3  0x000055639916a2b3 in ?? ()
#4  0x00005563991265eb in execute_ex ()
#5  0x00005563990d6191 in dtrace_execute_ex ()
#6  0x00005563990d7df9 in zend_call_function ()
#7  0x00007f5398263b39 in zephir_call_user_func_array_noex () from /usr/lib/php/20151012/phalcon.so
#8  0x00007f53984f3199 in zim_Phalcon_Mvc_Micro_handle () from /usr/lib/php/20151012/phalcon.so
#9  0x00005563990d62fa in dtrace_execute_internal ()
#10 0x000055639916afa0 in ?? ()
#11 0x00005563991265eb in execute_ex ()
#12 0x00005563990d6191 in dtrace_execute_ex ()
#13 0x000055639917a3b7 in zend_execute ()
#14 0x00005563990e6393 in zend_execute_scripts ()
#15 0x0000556399086c00 in php_execute_script ()
#16 0x0000556398f6d626 in main ()

Provide minimal script to reproduce the issue

var_dump(
            $this->auth('   contact@my(site).com', '        mytestpass123'),
        );

(if I remove syntax error - comma sign at the end of the statement, stack works fine)

This can happen anytime developer will omit closing } or comma sign. Those are user level errors and should not crash application server. 😕

Details

  • Phalcon version: 3.0.1
  • PHP Version: PHP 7.0.8-0ubuntu0.16.04.3
  • Operating System: Ubuntu Xerus 16.04 LTS amd64
  • Installation type: Compiling from source
  • Zephir version (if any): Version 0.9.4a-dev-7e304ba18c
  • Server: Nginx
  • Other related info (Database, table schema): MariaDB 10.1.18 (unrelated here since no DB query is being executed)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 28 (27 by maintainers)

Most upvoted comments

the lowest priority 😃 I’ll try to sort out in 3.1.x

The 3.0.2 version will be released on weekend

I’ll try to sort out as soon as I can