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

[BUG] Latest build of Phalcon 1.3.0 is crashing PHPEd #1714

Closed
temuri416 opened this issue Dec 20, 2013 · 50 comments
Closed

[BUG] Latest build of Phalcon 1.3.0 is crashing PHPEd #1714

temuri416 opened this issue Dec 20, 2013 · 50 comments

Comments

@temuri416
Copy link
Contributor

I had not updated 1.3.0 in about 6-7 weeks. Did that just a moment ago and my PHPEd debugger started crashing when breakpoint is triggered.

I cloned/compiled 1.2.4 - no problem there.

The message:
Fatal error while fetching local variables. Debug session has been terminated.

The following is being added to /var/log/kern.log:

kernel: [ 2213.378010] php-fpm[24084]: segfault at 282 ip 00007f87aef644de sp 00007fffbe358110 error 4 in dbg-php-5.5.so[7f87aef4d000+23000]

Also, there's a huge dump file created: /var/crash/_var_web_php_sbin_php-fpm.33.crash.

I started checking out commits by ID in reverse chronological order and found that problems started with commit ID

d21bbf9a779dfbb8598ec8608de60b27cf30d927 (12/11/2013 by Andres - Regenerating build [ci skip])

The one before it works fine.

Please help! :-)

Thanks!

@ghost
Copy link

ghost commented Dec 20, 2013

Could you please generate the backtrace?

gdb /path/to/php-fpm /path/to/core/dump

and then at gdb prompt run

bt full

@temuri416
Copy link
Contributor Author

I was finishing editing my post when you wrote that. Please read the edits.

Where do I find "/path/to/core/dump" ?

@temuri416
Copy link
Contributor Author

"/var/crash/_var_web_php_sbin_php-fpm.33.crash" is not a core dump: File format not recognized

@ghost
Copy link

ghost commented Dec 20, 2013

Are you using Ubuntu?

@temuri416
Copy link
Contributor Author

yes

@ghost
Copy link

ghost commented Dec 20, 2013

Run this as root:

cd /var/crash
apport-unpack _var_web_php_sbin_php-fpm.33.crash /var/crash/unpacked
chmod a+rX -R /var/crash/unpacked

then (i think this can be run as the ordinary user):

gdb /var/web/php/sbin/php-fpm /var/crash/unpacked/CoreDump

@temuri416
Copy link
Contributor Author

 gdb /var/web/php/sbin/php-fpm unpacked/CoreDump
GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /var/web/php/sbin/php-fpm...done.
[New LWP 7907]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff94fd000
Core was generated by `php-fpm: pool www                                                             '.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f039591b4de in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
(gdb)

bt full:

#0  0x00007f039591b4de in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#1  0x00007f039591b7e3 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#2  0x00007f039591bcf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#3  0x00007f039591bcf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#4  0x00007f039591b7e3 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#5  0x00007f039591b7e3 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#6  0x00007f039591bcf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#7  0x00007f039591bcf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#8  0x00007f039591bcf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#9  0x00007f039591b7e3 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#10 0x00007f039591bcf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#11 0x00007f039591bcf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#12 0x00007f039591ccc4 in dbg_serialize_hash () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#13 0x00007f03959163fe in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#14 0x00007f0395916a65 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#15 0x00007f0395917cd0 in dbg_send_std_action () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#16 0x00007f039590c90f in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#17 0x000000000080fa62 in zend_llist_apply_with_argument (l=<optimized out>, func=func@entry=0x843930 <zend_extension_statement_handler>, arg=0x2c95e18) at /root/php-5.5.1/Zend/zend_llist.c:234
        element = 0x2903530
#18 0x000000000086366b in ZEND_EXT_STMT_SPEC_HANDLER (execute_data=0x7f039fa6f780) at /root/php-5.5.1/Zend/zend_vm_execute.h:836
No locals.
#19 0x0000000000889c38 in execute_ex (execute_data=0x7f039fa6f780) at /root/php-5.5.1/Zend/zend_vm_execute.h:356
        ret = <optimized out>
        original_in_execution = 1 '\001'
#20 0x00007f039590f053 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#21 0x000000000080d381 in zend_call_function (fci=0x7ffff9484d00, fci_cache=0x7f039faa6270) at /root/php-5.5.1/Zend/zend_execute_API.c:939
        i = <optimized out>
        original_return_value = 0x0
        calling_symbol_table = 0x1353ca8 <executor_globals+360>
        original_op_array = 0x7f039faa6270
        original_opline_ptr = 0x7f039fa6f638
        current_scope = 0x297da40
        current_called_scope = 0x2abe890
        calling_scope = 0x2c8dc88
        called_scope = 0x7f039fa6f638
        current_this = 0x2c8dc88
        execute_data = {opline = 0x0, function_state = {function = 0x2c95e18, arguments = 0x7f039fa6f718}, op_array = 0x0, object = 0x2c3aa40, symbol_table = 0x1353ca8 <executor_globals+360>,
          prev_execute_data = 0x7ffff9485000, old_error_reporting = 0x0, nested = 0 '\000', original_return_value = 0x0, current_scope = 0x0, current_called_scope = 0x0, current_this = 0x0,
          fast_ret = 0x7f039fa6f688, call_slots = 0x7f039fa6f6e8, call = 0x7f039fa6f6e8}
        fci_cache_local = {initialized = 232 '\350', function_handler = 0x7f039fa6f6e8, calling_scope = 0x7f039fa6f718, called_scope = 0x2c8a2e8, object_ptr = 0x2ca0630}
#22 0x00007f0394e4985f in zim_Phalcon_Validation_Message_Group_valid () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
No symbol table info available.
#23 0x0000000002c95e18 in ?? ()
No symbol table info available.
#24 0x0000000002cb2c88 in ?? ()
No symbol table info available.
#25 0x0000000002cb2c88 in ?? ()
No symbol table info available.
#26 0x0000000002c3aa40 in ?? ()
No symbol table info available.
#27 0x0000000000827ffa in _zend_hash_index_update_or_next_insert (ht=0x7ffff9484e18, h=46335744, h@entry=0, pData=0x2c8a4d0, pData@entry=0x7ffff9484d58, nDataSize=nDataSize@entry=8, pDest=0x2c2f730,
    pDest@entry=0x0, flag=flag@entry=4) at /root/php-5.5.1/Zend/zend_hash.c:412
        nIndex = <optimized out>
        p = 0x1
#28 0x000000000081fb46 in add_next_index_zval (arg=<optimized out>, value=0x2c8dc88) at /root/php-5.5.1/Zend/zend_API.c:1470
No locals.
#29 0x00007f0394f29c7a in zim_Phalcon_Dispatcher_dispatch () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
No symbol table info available.
#30 0x00007f0394e60063 in zim_Phalcon_Cache_Frontend_Base64_beforeStore () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so
No symbol table info available.
#31 0x0000000002abe890 in ?? ()
No symbol table info available.
#32 0x0000000002c2f878 in ?? ()
No symbol table info available.
#33 0x0000000000000000 in ?? ()
No symbol table info available.

@ghost
Copy link

ghost commented Dec 20, 2013

Does it run fine without the debugger?

@temuri416
Copy link
Contributor Author

Yes.

@ghost
Copy link

ghost commented Dec 20, 2013

OK, could you please build Phalcon from ext/ in debug mode and try again? This should produce more meaningful backtrace.

cd ext
phpize
./configure CFLAGS="-O0 -g3"
make -j4
sudo make install

@temuri416
Copy link
Contributor Author

/var/crash# gdb /var/web/php/sbin/php-fpm unpacked/CoreDump
GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /var/web/php/sbin/php-fpm...done.
[New LWP 14746]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff3733a000
Core was generated by `php-fpm: pool www                                                             '.
Program terminated with signal 11, Segmentation fault.
#0  0x00007fb22541e4de in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so

bt full:

#0  0x00007fb22541e4de in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#1  0x00007fb22541e7e3 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#2  0x00007fb22541ecf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#3  0x00007fb22541ecf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#4  0x00007fb22541e7e3 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#5  0x00007fb22541e7e3 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#6  0x00007fb22541ecf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#7  0x00007fb22541ecf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#8  0x00007fb22541ecf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#9  0x00007fb22541e7e3 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#10 0x00007fb22541ecf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#11 0x00007fb22541ecf0 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#12 0x00007fb22541fcc4 in dbg_serialize_hash () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#13 0x00007fb2254193fe in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#14 0x00007fb225419a65 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#15 0x00007fb22541acd0 in dbg_send_std_action () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#16 0x00007fb22540f90f in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#17 0x000000000080fa62 in zend_llist_apply_with_argument (l=<optimized out>, func=func@entry=0x843930 <zend_extension_statement_handler>, arg=0x7fb2167374b0) at /root/php-5.5.1/Zend/zend_llist.c:234
        element = 0x2cad520
#18 0x000000000086366b in ZEND_EXT_STMT_SPEC_HANDLER (execute_data=0x7fb22f572780) at /root/php-5.5.1/Zend/zend_vm_execute.h:836
No locals.
#19 0x0000000000889c38 in execute_ex (execute_data=0x7fb22f572780) at /root/php-5.5.1/Zend/zend_vm_execute.h:356
        ret = <optimized out>
        original_in_execution = 1 '\001'
#20 0x00007fb225412053 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#21 0x000000000080d381 in zend_call_function (fci=0x7fff3726a630, fci_cache=0x7fb22f5a8e40) at /root/php-5.5.1/Zend/zend_execute_API.c:939
        i = <optimized out>
        original_return_value = 0x0
        calling_symbol_table = 0x1353ca8 <executor_globals+360>
        original_op_array = 0x7fb22f5a8e40
        original_opline_ptr = 0x7fb22f572638
        current_scope = 0x2d27a30
        current_called_scope = 0x2e63f10
        calling_scope = 0x7fb216729c10
        called_scope = 0x7fb22f572638
        current_this = 0x7fb216729c10
        execute_data = {opline = 0x0, function_state = {function = 0x7fb2167374b0, arguments = 0x7fb22f572718}, op_array = 0x0, object = 0x7fb21672e298, symbol_table = 0x1353ca8 <executor_globals+360>,
          prev_execute_data = 0x7fff3726b090, old_error_reporting = 0x0, nested = 0 '\000', original_return_value = 0x0, current_scope = 0x0, current_called_scope = 0x0, current_this = 0x0,
          fast_ret = 0x7fb22f572688, call_slots = 0x7fb22f5726e8, call = 0x7fb22f5726e8}
        fci_cache_local = {initialized = 104 'h', function_handler = 0x7fb21672e298, calling_scope = 0x7fff3726a5f0, called_scope = 0x1f839dfd, object_ptr = 0x7fb21673eef8}
#22 0x00007fb21f83a7bb in phalcon_call_user_func_array_noex (return_value=0x7fb21672e268, handler=0x7fb21672e620, params=0x7fb22f416888) at /root/cphalcon/ext/kernel/fcall.c:588
        retval_ptr = 0x0
        fci = {size = 72, function_table = 0x7fb216737188, function_name = 0x7fb21672e620, symbol_table = 0x0, retval_ptr_ptr = 0x7fff3726a5d8, param_count = 0, params = 0x7fb21673f6b0,
          object_ptr = 0x7fb21672e298, no_separation = 1 '\001'}
        fci_cache = {initialized = 1 '\001', function_handler = 0x7fb2167374b0, calling_scope = 0x7fb216737160, called_scope = 0x7fb216737160, object_ptr = 0x7fb21672e298}
        is_callable_error = 0x0
        status = 0
#23 0x00007fb21fa28d3d in zim_Phalcon_Dispatcher_dispatch (ht=0, return_value=0x7fb216729fb0, return_value_ptr=0x7fff3726b168, this_ptr=0x7fb216729c10, return_value_used=1) at /root/cphalcon/ext/dispatcher.c:863
        exception_code = 0x0
        exception_message = 0x0
        status = 0x7fb22f418678
        value = 0x7fb21672e268
        handler = 0x7fb21672e298
        camelized_class = 0x7fb21672e538
        handler_class = 0x7fb21672e568
        has_service = 0x7fb21672f2f0
        was_fresh = 0x7fb21672e508
        action_method = 0x7fb21672e480
        params = 0x7fb22f416888
        call_object = 0x7fb21672e620
        exception = 0x0
        dependency_injector = 0x7fb22f3eb268
        events_manager = 0x7fb22f416d88
        tmp = 0x2cb7490
        handler_suffix = 0x2e64dc0
        action_suffix = 0x2d2b1c0
        namespace_name = 0x7fb22f405880
        handler_name = 0x7fb22f4057c0
        action_name = 0x7fb21672ed38
        number_dispatches = 1
        __FUNCTION__ = "zim_Phalcon_Dispatcher_dispatch"
#24 0x00007fb21f85964e in phalcon_alt_call_method (fci=0x7fff3726b1d0, ce=0x2e63f10, hash_key=16010035357333126649, method_name=0x7fb21fcd9f7e "dispatch", method_len=8, method_key=249885466386540501)
    at /root/cphalcon/ext/kernel/alternative/fcall.c:827
        call_via_handler = 0
        i = 0
        executor_globals_ptr = 0x1353b40 <executor_globals>
        phalcon_globals_ptr = 0x7fb224da99c0 <phalcon_globals>
        original_return_value = 0x0
        calling_symbol_table = 0x1353ca8 <executor_globals+360>
        original_op_array = 0x7fb22f5a8e40
        original_opline_ptr = 0x7fb22f572638
        current_scope = 0x2e63f10
        current_called_scope = 0x7fb22f5abb30
        calling_scope = 0x2e63f10
        called_scope = 0x2e63f10
        current_this = 0x7fb22f3fcbd8
        execute_data = {opline = 0x0, function_state = {function = 0x2e68350, arguments = 0x7fb22f572710}, op_array = 0x0, object = 0x7fb216729c10, symbol_table = 0x1353ca8 <executor_globals+360>,
          prev_execute_data = 0x7fb22f572638, old_error_reporting = 0x0, nested = 0 '\000', original_return_value = 0x0, current_scope = 0x0, current_called_scope = 0x0, current_this = 0x0,
          fast_ret = 0x7fb22f572688, call_slots = 0x7fb22f5726e8, call = 0x7fb22f5726e8}
        fci_cache = 0x7fff3726b060
        fci_local = {initialized = 1 '\001', function_handler = 0x2e68350, calling_scope = 0x2e63f10, called_scope = 0x2e63f10, object_ptr = 0x7fb216729c10}
        function_handler = 0x7fb22f405b10
        exists = 0
        is_phalcon_function = 1
#25 0x00007fb21f859e93 in phalcon_alt_call_user_method (ce=0x2e63f10, object_pp=0x7fff3726b268, method_name=0x7fb21fcd9f7e "dispatch", method_len=8, retval_ptr=0x7fb216729800, retval_ptr_ptr=0x0, param_count=0,
    params=0x0, method_key=249885466386540501) at /root/cphalcon/ext/kernel/alternative/fcall.c:955
        phalcon_globals_ptr = 0x7fb224da99c0 <phalcon_globals>
        params_array = 0x0
        static_params_array = {0x7fff3726b2b0, 0x0, 0x0, 0x0, 0x2ab2200}
        i = 8
        ex_retval = 0
        local_retval_ptr = 0x7fb216729fb0
        fci = {size = 72, function_table = 0x2e63f38, function_name = 0x0, symbol_table = 0x0, retval_ptr_ptr = 0x7fff3726b168, param_count = 0, params = 0x7fff3726b1a0, object_ptr = 0x7fb216729c10,
          no_separation = 1 '\001'}
        hash_key = 16010035357333126649
#26 0x00007fb21f839738 in phalcon_call_method_vparams (return_value=0x7fb216729800, return_value_ptr=0x0, object=0x7fb216729c10, method_name=0x7fb21fcd9f7e "dispatch", method_len=8, method_key=249885466386540501,
    param_count=0, ap=0x7fff3726b358) at /root/cphalcon/ext/kernel/fcall.c:261
        i = 1
        status = 0
        free_params = 0
        caller_wants_result = 1
        ce = 0x2e63f10
        active_scope = 0x0
        params_ptr = 0x0
        params = 0x0
        static_params = {0x7fb22f416888, 0x7fb21b2206a8, 0xffffffff, 0x7fb21f843d1e <phalcon_hash_quick_exists+161>, 0x8de7ffcc47e217ba, 0xe02ab2200, 0x7fb21fcdd76d, 0x7fb22f5abba0, 0x21b201ce8,
          0x7fb21f843eb8 <phalcon_hash_quick_find+169>}
#27 0x00007fb21f839dfd in phalcon_call_method_params (return_value=0x7fb216729800, return_value_ptr=0x0, object=0x7fb216729c10, method_name=0x7fb21fcd9f7e "dispatch", method_len=8, method_key=249885466386540501,
    param_count=0) at /root/cphalcon/ext/kernel/fcall.c:399
        status = 0
        ap = {{gp_offset = 48, fp_offset = 48, overflow_arg_area = 0x7fff3726b438, reg_save_area = 0x7fff3726b370}}
#28 0x00007fb21f976ecc in zim_Phalcon_Mvc_Application_handle (ht=0, return_value=0x7fb22f3df8a0, return_value_ptr=0x0, this_ptr=0x7fb22f3fcbd8, return_value_used=1) at /root/cphalcon/ext/mvc/application.c:506
        _key = 0
        uri = 0x2cb7430
        dependency_injector = 0x7fb22f3eb268
        events_manager = 0x2cd63f0
        event_name = 0x0
        status = 0x0
        service = 0x7fb22f3df908
        router = 0x7fb22f405450
        module_name = 0x7fb22f4055a0
        module_object = 0x7fb22f405570
        modules = 0x7fb22f405420
        module = 0x7fb22f3ebf70
        class_name = 0x7fb22f3eb7b0
        path = 0x7fb22f3ec630
        module_params = 0x7fff3726b638
        implicit_view = 0x2e584d0
        view = 0x7fb22f406640
        namespace_name = 0x7fb22f405880
        controller_name = 0x7fb22f4057c0
        action_name = 0x7fb22f406720
        params = 0x7fb22f416888
        dispatcher = 0x7fb216729c10
        controller = 0x7fb216729800
        returned_response = 0x0
        possible_response = 0x7fff3726b680
        render_status = 0x0
        response = 0x0
        content = 0x7fb21f8397dd <phalcon_call_method_vparams+965>
        f_implicit_view = 1
        __FUNCTION__ = "zim_Phalcon_Mvc_Application_handle"
#29 0x00007fb22540eefc in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#30 0x00000000008c9b9b in zend_do_fcall_common_helper_SPEC (execute_data=0x7fb22f572638) at /root/php-5.5.1/Zend/zend_vm_execute.h:545
        ret = 0x7fb22f572618
        opline = 0x7fb217727060
        should_change_scope = 1 '\001'
        fbc = 0x7fb22f5ae138
#31 0x0000000000889c38 in execute_ex (execute_data=0x7fb22f572638) at /root/php-5.5.1/Zend/zend_vm_execute.h:356
        ret = <optimized out>
        original_in_execution = 0 '\000'
#32 0x00007fb225412053 in ?? () from /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so
No symbol table info available.
#33 0x000000000081c8e9 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /root/php-5.5.1/Zend/zend.c:1316
        files = {{gp_offset = 40, fp_offset = 0, overflow_arg_area = 0x7fff3726c270, reg_save_area = 0x7fff3726c200}}
        i = <optimized out>
        file_handle = 0x7fff3726e660
        orig_op_array = 0x0
        orig_retval_ptr_ptr = 0x0
        orig_interactive = 0
#34 0x00000000007bb70c in php_execute_script (primary_file=primary_file@entry=0x7fff3726e660) at /root/php-5.5.1/main/main.c:2484
        realfile = "(\000\000\000\000\000\000\000,\000\000\000\002\000\000\000@\326&7\377\177\000\000\024z</\262\177\000\000@\326&7\377\177\000\000p\324\306+\262\177\000\000@\333&7\377\177\000\000\060\333&7\377\177\000\000U\337\364\000\000\000\000\000\002\000\000\000\000\000\000\000\250\334&7\377\177\000\000B\t\312+\262\177\000\000\003\000\000\000\060\000\000\000[\000\000\000n\000\000\000w\000\000\000\001\000\000\000 \325&7", '\000' <repeats 20 times>, "\240\333&7\377\177\000\000\220\333&7\377\177\000\000K+\365\000\000\000\000\000M+\365\000\000\000\000\000\030\335&7\377\177\000\000B\t\312+\262\177\000\000\001\000\003\000\005\000\000\000"...
        __orig_bailout = <optimized out>
        __bailout = {{__jmpbuf = {20264768, 925918695748193129, 0, 140403275142712, 0, 1, 925918694749948777, -925515427650417815}, __mask_was_saved = 0, __saved_mask = {__val = {15404559, 15404579,
                140403219203904, 0, 140403219203904, 40, 49841776, 0, 40, 2, 140403215803776, 49841776, 49841824, 47, 140403273377085, 18}}}}
        prepend_file_p = <optimized out>
        append_file_p = 0x0
        prepend_file = {type = ZEND_HANDLE_FILENAME, filename = 0x0, opened_path = 0x0, handle = {fd = 0, fp = 0x0, stream = {handle = 0x0, isatty = 0, mmap = {len = 0, pos = 0, map = 0x0, buf = 0x0,
                old_handle = 0x0, old_closer = 0x0}, reader = 0x0, fsizer = 0x0, closer = 0x0}}, free_filename = 0 '\000'}
        append_file = {type = ZEND_HANDLE_FILENAME, filename = 0x0, opened_path = 0x0, handle = {fd = 0, fp = 0x0, stream = {handle = 0x0, isatty = 0, mmap = {len = 0, pos = 0, map = 0x0, buf = 0x0,
                old_handle = 0x0, old_closer = 0x0}, reader = 0x0, fsizer = 0x0, closer = 0x0}}, free_filename = 0 '\000'}
        old_cwd = 0x7fff3726c280 "/"
        retval = 0
#35 0x0000000000479284 in main (argc=<optimized out>, argv=<optimized out>) at /root/php-5.5.1/sapi/fpm/fpm/fpm_main.c:1933
        primary_script = 0x7fb22f5a8ce8 "/var/web/nginx/html/krfs/public/index.php"
        __orig_bailout = 0x0
        __bailout = {{__jmpbuf = {0, -925515664228430999, 70, 140734118694623, 4294967295, 0, 925918695733513065, -925515118545548439}, __mask_was_saved = 0, __saved_mask = {__val = {0 <repeats 16 times>}}}}
        exit_status = 0
        c = <optimized out>
        use_extended_info = 0
        file_handle = {type = ZEND_HANDLE_FILENAME, filename = 0x7fb22f572558 "/var/web/nginx/html/krfs/public/index.php", opened_path = 0x0, handle = {fd = 0, fp = 0x0, stream = {handle = 0x0, isatty = 0,
              mmap = {len = 0, pos = 0, map = 0x0, buf = 0x0, old_handle = 0x0, old_closer = 0x0}, reader = 0x0, fsizer = 0x0, closer = 0x0}}, free_filename = 0 '\000'}
        orig_optind = 1
        orig_optarg = 0x0
        ini_entries_len = <optimized out>
        max_requests = 0
        requests = 0
        fcgi_fd = 20264768
        request = {listen_socket = 0, fd = 4, id = 1, keep = 0, closed = 0, in_len = 0, in_pad = 0, out_hdr = 0x0, out_pos = 0x7fff3726e9f0 "", out_buf = '\000' <repeats 8191 times>,
          reserved = '\000' <repeats 15 times>, env = 0x7fb22f5712f0}
        fpm_config = 0x7fff37270edf ""
        fpm_prefix = 0x0
        fpm_pid = 0x7fff37270efb ""
        test_conf = 0
        force_daemon = 1
        php_information = 0
        php_allow_to_run_as_root = 0
        __func__ = "main"
(gdb)

@temuri416
Copy link
Contributor Author

Gotta step out.. Will be available next morning. Please let me know if you figure anything out.

Clearly, something in that commit broke the debugger.

Thanks!

@temuri416
Copy link
Contributor Author

@sjinks

I'm back... Any thoughts? This is an absolute nightmare scenario for me. I'm too far into my project to start again. And no debugger is a disaster...

@ghost
Copy link

ghost commented Dec 20, 2013

This backtrace looks totally different — though it is possible that the crash happened in the same place as before, it was triggered by a different code path.

The first crash happened when Phalcon\Validation\Message\Group::valid() was called, the second one happened when Phalcon\Dispatcher::dispatch() called the controller/action handler.

Is there any source code for dbg-php-5.5.so or is it proprietary?

Also is there a way to run php under valgrind?

@ghost
Copy link

ghost commented Dec 20, 2013

I am running the tests under valgrind: https://travis-ci.org/sjinks/cphalcon/builds/15769025 to see if it detects anything wrong.

@temuri416
Copy link
Contributor Author

dbg-php-5.5.so is proprietary. I am at a workstation now with different environment, I am going to see if the same problem occurs here.

@temuri416
Copy link
Contributor Author

yea, exactly the same thing. slightly different Ubuntu configuration, but identical result.

but what was in the commit

d21bbf9a779dfbb8598ec8608de60b27cf30d927

that may have introduced the problem? what if you start looking there?

@ghost
Copy link

ghost commented Dec 20, 2013

what if you start looking there?

"Regenerated build" commits contain several weeks of works — these commits merge all files from ext/ into one and put it into build/.

To find out what commit introduced the bug you need to check all commits and build phalcon from ext/, this is probably the only way.

@temuri416
Copy link
Contributor Author

ok, I have no problem doing that.

Can you give me any idea of the time range I should be looking at?

@ghost
Copy link

ghost commented Dec 20, 2013

BTW, did you build PHP yourself?

@temuri416
Copy link
Contributor Author

build phalcon from ext/

to do that I have to do php gen-build.php?

@temuri416
Copy link
Contributor Author

yes, I compiled PHP myself.

@ghost
Copy link

ghost commented Dec 20, 2013

I would try bisection — try the commit that lays in the middle between the latest and the last one you built Phalcon from. If it fails, go towards the last successful build, if succeeds, go towards the latest commit.

@ghost
Copy link

ghost commented Dec 20, 2013

to do that I have to do php gen-build.php?

No.

cd ext
git checkout <commit hash goes here>
phpize
./configure CFLAGS="-O0 -g3"
make -j4
sudo make install

To speed up build you can use a higher number after -j. My home PC has 8 GB RAM and it can run make -j75.

@ghost
Copy link

ghost commented Dec 20, 2013

yes, I compiled PHP myself.

For debugging I usually use PHP built with --enable-debug option but now I am not sure whether dbg-php-5.5.so will be able to handle that.

@temuri416
Copy link
Contributor Author

thanks, I started looking for a breaking change.

@ghost
Copy link

ghost commented Dec 20, 2013

There is another option: you can contact NuSphere support and refer them to this issue. Because everything runs fine without the debugger and the crash happens inside /var/web/php/lib/php/extensions/no-debug-non-zts-20121212/dbg-php-5.5.so, chances are that the bug is really in their extension. At least maybe they could provide you with a debug build of dbg-php-5.5.so.

@ghost
Copy link

ghost commented Dec 20, 2013

If they need a test server, I can provide it.

@temuri416
Copy link
Contributor Author

you know, it is extremely difficult to communicate with NuSphere. they never admit to existence of bugs in their software, and their standard response is "can't reproduce".

I'd rather exhaust all other options first.

@ghost
Copy link

ghost commented Dec 20, 2013

Question: does Phalcon loads before or after dbg-php-5.5? If before, please try to load it (Phalcon) very last.

@temuri416
Copy link
Contributor Author

Phalcon is loaded AFTER dbg module.

@temuri416
Copy link
Contributor Author

alright, I have found the problem commit.

It is:

c4351e6feb3e5138f3026e9e790b9fdf2b47fb25  30/10/13      Phalcon
Merge pull request #1473 from sjinks/fastdi
Faster version of Phalcon\DI using object handlers

The one before it handles PHPEd breakpoints just fine:

30/10/13
Merge pull request #1477 from dreamsxin/request_file
Use FILEINFO_MIME_TYPE for \Pahlcon\Request\File::getRealType

Anything else I can do?

@ghost
Copy link

ghost commented Dec 20, 2013

This is very sad :-(

OK, could you please comment out line 489 in ext/di.c:

phalcon_di_object_handlers.get_properties  = phalcon_di_get_properties;

and try again?

@temuri416
Copy link
Contributor Author

commit Id

c4351e6feb3e5138f3026e9e790b9fdf2b47fb25

line 489 of ext/di.c is:

phalcon_fetch_params_ex(2, 1, &name, &definition, &shared);

your code is at line number 454.

Commenting your code out at line 454 fixed the problem. PHPEd's debugbreaks don't crash anymore.

@ghost
Copy link

ghost commented Dec 20, 2013

OK, I thought so. Could you please do the same for the latest 1.3.0 and see if it works?

@ghost
Copy link

ghost commented Dec 20, 2013

Also if you run php -m, how is dbg-php called in that list?

@temuri416
Copy link
Contributor Author

php-m:

[Zend Modules]
DBG

@ghost
Copy link

ghost commented Dec 20, 2013

OK, please let me know if commenting out phalcon_di_object_handlers.get_properties works in the latest Phalcon and if so, I will add detection of dbg-php to apply that workaround automatically.

@temuri416
Copy link
Contributor Author

would a workaround mean that whoever's using PHPEd would miss out on some DI-related (new & great) features?

@ghost
Copy link

ghost commented Dec 20, 2013

With that workaround you won't be able to see the internal properties of DI which is still better than the crash :-)

All other features remain intact.

And if possible, please show NuSphere this thread — hopefully they will be able to fix the debugger.

@temuri416
Copy link
Contributor Author

ok, commenting out that code in latest commit does fix the issue. everything is working.

regarding NuSphere - I could try filing a bug. what low-level details might help them identify the problem?

@ghost
Copy link

ghost commented Dec 20, 2013

They will definitely ask you for the code that reproduces the bug.

Please tell them the commit ID of 1.3.0 where the bug happens.

This is the handler that returns all internal properties of DI: https://github.com/phalcon/cphalcon/blob/1.3.0/ext/di.c#L379

If they need any other info, either you ask me or ask them to leave a comment here.

Thanks!

@temuri416
Copy link
Contributor Author

ok, I appreciate your time.

would you please update the thread once you put in the promised workaround in.

@ghost
Copy link

ghost commented Dec 20, 2013

Once this build succeeds, I will submit a PR.

@ghost
Copy link

ghost commented Dec 20, 2013

Could you please check that PhpEd can handle this code:

<?php
$a = array();
$a['a'] = &$a;
$a['b'] = 123;
$c = new \Phalcon\Config($a);
$c['a']['c'] = $c;
print_r($c);
?>

There will be a warning, "Warning: Phalcon\Config::__construct(): Recursion detected", this is OK

@temuri416
Copy link
Contributor Author

With the latest code and with your DI code commented out:

  1. here's browser output:
<br />
<b>Warning</b>:  Phalcon\Config::__construct(): Recursion detected in <b>/var/web/nginx/html/krfs/public/z.php</b> on line <b>5</b><br />
Phalcon\Config Object
(
    [a] => Phalcon\Config Object
        (
            [b] => 123
            [c] => Phalcon\Config Object
 *RECURSION*
        )

    [b] => 123
)
  1. I was able to put a breakpoint at the very top and was able to step over a single line without any crash.

@ghost
Copy link

ghost commented Dec 20, 2013

PR submitted.

@ghost
Copy link

ghost commented Dec 20, 2013

Merged :-)

@temuri416
Copy link
Contributor Author

You rock! Thanks a lot.

Any chance for you to take another look at #1624 ?

I know that me & my PHPEd are a real pain in the ass :-)

@phalcon
Copy link
Collaborator

phalcon commented Dec 27, 2013

Fixed in 1.3.0

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