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

fix symbol_table op #468

Merged
merged 2 commits into from
Mar 24, 2020
Merged

fix symbol_table op #468

merged 2 commits into from
Mar 24, 2020

Conversation

xinhaiz
Copy link
Contributor

@xinhaiz xinhaiz commented Mar 23, 2020

must have PHP configured with --enable-debug

PHP-FPM Error log:
child 27689 exited on signal 6 (SIGABRT - core dumped) after 10.906112 seconds from start

LLDB BT:

(lldb) bt
* thread #1, stop reason = signal SIGSTOP
  * frame #0: 0x00007fff67de47fa libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff67ea1bc1 libsystem_pthread.dylib`pthread_kill + 432
    frame #2: 0x00007fff67d6ba1c libsystem_c.dylib`abort + 120
    frame #3: 0x00007fff67d6acd6 libsystem_c.dylib`__assert_rtn + 314
    frame #4: 0x000000010e04a3d7 php-fpm`_zend_hash_add_or_update_i(ht=0x0000000111506180, key=0x000000011204c040, pData=0x00000001114f28c0, flag=8) at zend_hash.c:734:4
    frame #5: 0x000000010e04a15a php-fpm`zend_hash_add_new(ht=0x0000000111506180, key=0x000000011204c040, pData=0x00000001114f28c0) at zend_hash.c:889:9
    frame #6: 0x000000011180a3ab yaf.so`yaf_view_build_symtable(tpl_vars=0x000000011150b268, vars=0x0000000111418300) at yaf_view_simple.c:145:9
    frame #7: 0x0000000111809e28 yaf.so`yaf_view_simple_render(view=0x00000001114182c0, tpl=0x00000001114182f0, vars=0x0000000111418300, ret=0x0000000111418290) at yaf_view_simple.c:309:17
    frame #8: 0x000000011180bfd5 yaf.so`zim_yaf_view_simple_render(execute_data=0x00000001114182a0, return_value=0x0000000111418290) at yaf_view_simple.c:586:7
    frame #9: 0x000000010e0e613f php-fpm`ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER(execute_data=0x0000000111418220) at zend_vm_execute.h:1730:4
    frame #10: 0x000000010e0a5c14 php-fpm`execute_ex(ex=0x0000000111418160) at zend_vm_execute.h:53611:7
    frame #11: 0x000000010e0122b1 php-fpm`zend_call_function(fci=0x00007ffee2347198, fci_cache=0x00007ffee2347118) at zend_execute_API.c:812:3
    frame #12: 0x000000010e065072 php-fpm`zend_call_method(object=0x0000000111403588, obj_ce=0x0000000111408d40, fn_proxy=0x0000000000000000, function_name="render", function_name_len=6, retval_ptr=0x00007ffee23472b0, param_count=1, arg1=0x00007ffee23472c0, arg2=0x0000000000000000) at zend_interfaces.c:103:12
    frame #13: 0x000000011180cf3d yaf.so`yaf_controller_render(instance=0x0000000111418120, action_name="index", len=5, var_array=0x0000000000000000) at yaf_controller.c:135:3
    frame #14: 0x000000011180f2cb yaf.so`zim_yaf_controller_render(execute_data=0x0000000111418100, return_value=0x00007ffee2347808) at yaf_controller.c:485:25
    frame #15: 0x000000010e01238a php-fpm`zend_call_function(fci=0x00007ffee23475f8, fci_cache=0x00007ffee2347578) at zend_execute_API.c:825:4
    frame #16: 0x000000010e065072 php-fpm`zend_call_method(object=0x00007ffee23477d0, obj_ce=0x0000000111411940, fn_proxy=0x0000000000000000, function_name="render", function_name_len=6, retval_ptr=0x00007ffee2347808, param_count=1, arg1=0x00007ffee23477f8, arg2=0x0000000000000000) at zend_interfaces.c:103:12
    frame #17: 0x00000001117f1fe8 yaf.so`yaf_dispatcher_handle(dispatcher=0x0000000111472038, request=0x0000000111403248, response=0x00007ffee2347ba0, view=0x0000000111403238) at yaf_dispatcher.c:627:7
    frame #18: 0x00000001117f370e yaf.so`yaf_dispatcher_dispatch(dispatcher=0x0000000111472038, response_ptr=0x00007ffee2347ba0) at yaf_dispatcher.c:821:8
    frame #19: 0x00000001117ee708 yaf.so`zim_yaf_application_run(execute_data=0x00000001114180b0, return_value=0x00007ffee2347ba0) at yaf_application.c:466:6
    frame #20: 0x000000010e0e5b54 php-fpm`ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER(execute_data=0x0000000111418020) at zend_vm_execute.h:1618:4
    frame #21: 0x000000010e0a5c14 php-fpm`execute_ex(ex=0x0000000111418020) at zend_vm_execute.h:53611:7
    frame #22: 0x000000010e0a5e4b php-fpm`zend_execute(op_array=0x0000000111403000, return_value=0x0000000000000000) at zend_vm_execute.h:57913:2
    frame #23: 0x000000010e0316c2 php-fpm`zend_execute_scripts(type=8, retval=0x0000000000000000, file_count=3) at zend.c:1665:4
    frame #24: 0x000000010df7cce6 php-fpm`php_execute_script(primary_file=0x00007ffee2348740) at main.c:2617:14
    frame #25: 0x000000010e157a0a php-fpm`main(argc=6, argv=0x00007ffee2348a68) at fpm_main.c:1942:4
    frame #26: 0x00007fff67c9d7fd libdyld.dylib`start + 1
    frame #27: 0x00007fff67c9d7fd libdyld.dylib`start + 1

@laruence
Copy link
Owner

any reproducible script? the changes seems make no difference .

@laruence
Copy link
Owner

and which version of yaf do you use?

@xinhaiz
Copy link
Contributor Author

xinhaiz commented Mar 23, 2020

PHP 7.4.4(DEBUG) + Yaf 3.1.3

@laruence
Copy link
Owner

I didn’t get where is wrong, you change to zend_view_simple.c makes no difference.

zend_array is exactlly same as Hashtable
and ALLOC_HASHTABLE is emalloc(sizoef(Hashtable))

and also, the test script in your PR, is passed here with Yaf-3.1.3

@xinhaiz
Copy link
Contributor Author

xinhaiz commented Mar 24, 2020

You must have PHP configured with --enable-debug!
Working in dev-environ~

@xinhaiz
Copy link
Contributor Author

xinhaiz commented Mar 24, 2020

Build complete.
Don't forget to run 'make test'.


=====================================================================
PHP         : */7.4/bin/php 
PHP_SAPI    : cli
PHP_VERSION : 7.4.4
ZEND_VERSION: 3.4.0
PHP_OS      : Darwin - Darwin **** 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; 
*
INI actual  : */yaf-3.1.3/tmp-php.ini
More .INIs  :   
---------------------------------------------------------------------
PHP         : */7.4/bin/phpdbg 
PHP_SAPI    : phpdbg
PHP_VERSION : 7.4.4
ZEND_VERSION: 3.4.0
PHP_OS      : Darwin - Darwin * 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; 
*
INI actual  :*/yaf-3.1.3/tmp-php.ini
More .INIs  : 
---------------------------------------------------------------------
CWD         : */yaf-3.1.3
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2020-03-24 10:21:02
=====================================================================
PASS Check for yaf presence [tests/001.phpt] 
PASS Check for Yaf_Request_Simple [tests/002.phpt] 
PASS Check for Yaf_Loader [tests/003.phpt] 
PASS Check for Yaf_Registry [tests/004.phpt] 
PASS Check for Yaf_Response [tests/005.phpt] 
PASS Check for Yaf_Route_Static [tests/006.phpt] 
PASS Check for Yaf_Config_Simple [tests/007.phpt] 
PASS Check for Yaf_Router [tests/008.phpt] 
PASS Check for Yaf_View_Simple [tests/009.phpt] 
PASS Check for Yaf_Config_Ini [tests/010.phpt] 
PASS Check for Yaf_Route_Rewrite [tests/011.phpt] 
PASS Check for Yaf_Route_Regex [tests/012.phpt] 
PASS Check for Yaf_Router and Config Routes [tests/013.phpt] 
PASS Check for Yaf_Application [tests/014.phpt] 
PASS Check for Yaf_Exception [tests/015.phpt] 
PASS Check for Yaf_Session [tests/016.phpt] 
PASS Bug (mem leak and crash in Yaf_Config_Ini) [tests/017.phpt] 
PASS Bug Yaf_Config_Ini crash due to inaccurate refcount [tests/018.phpt] 
PASS Yaf_Router::getCurrent with number key [tests/019.phpt] 
PASS Check for Yaf_Application [tests/020.phpt] 
PASS Check for Yaf_Application [tests/021.phpt] 
PASS Check for Yaf_Application [tests/022.phpt] 
PASS Check for Yaf_Loader::set/get(library_path) [tests/023.phpt] 
PASS Check for Yaf_Loader::getInstace() paramters [tests/024.phpt] 
PASS Check for Yaf_Loader with namespace configuration [tests/025.phpt] 
PASS Check for Yaf_Response::setBody/prependBody/appendBody [tests/026.phpt] 
PASS Check for Yaf autoload controller [tests/027.phpt] 
PASS Bug segfault while call exit in a view template [tests/028.phpt] 
PASS Check for Yaf_View_Simple::get and clear [tests/029.phpt] 
PASS Check for Yaf_Config_Ini::__construct with section [tests/030.phpt] 
PASS Check for application.dispatcher.defaultRoute [tests/031.phpt] 
PASS Check for Yaf_Config_Ini with env [tests/032.phpt] 
PASS Check for Yaf_View_Simple with predefined template dir [tests/033.phpt] 
PASS Check for Yaf_View_Simple::eval [tests/034.phpt] 
SKIP Check for Yaf_View_Simple with short_tag_open [tests/035.phpt] reason: PHP 5.4 remove short_open_tag
PASS Check for Yaf_Route_Static with arbitrary urls [tests/036.phpt] 
PASS Check for Yaf_Loader and open_basedir [tests/037.phpt] 
PASS Check for Yaf_View_Simple error message outputing [tests/038.phpt] 
PASS Check for Yaf_View_Simple recursive render error message outputing [tests/039.phpt] 
PASS Fixed bug that segv in Yaf_View_Simple::render if the tpl is not a string [tests/040.phpt] 
PASS Check for controller return false preventing auto-renderring [tests/041.phpt] 
PASS Check for throw exception in Yaf_Controller::init [tests/042.phpt] 
PASS Check for yaf.system settings [tests/043.phpt] 
PASS Memleaks in Yaf_Dispatcher::getInstance() [tests/044.phpt] 
PASS Check for segfault while use closure as error handler [tests/045.phpt] 
PASS Check for Yaf_Loader with single class [tests/046.phpt] 
PASS Check for Yaf_Loader with spl_autoload [tests/047.phpt] 
PASS Check for Sample application [tests/048.phpt] 
PASS Check for Sample application with exception [tests/049.phpt] 
PASS Check for Sample application with return response [tests/050.phpt] 
PASS Fixed bug that segfault while a abnormal object set to Yaf_Route*::route [tests/051.phpt] 
PASS Check for Yaf_Request APis [tests/052.phpt] 
PASS Check for Custom view engine [tests/053.phpt] 
PASS check for Various segfault [tests/054.phpt] 
PASS check for Yaf_Dispatcher::autoRender [tests/055.phpt] 
PASS check for Yaf_Dispatcher::throwException [tests/056.phpt] 
PASS check for Yaf_Dispatcher::catchException [tests/057.phpt] 
PASS check for Yaf_Dispatcher::flushInstantly [tests/058.phpt] 
PASS Check nesting view render [tests/059.phpt] 
PASS Check for working with other autoloaders [tests/060.phpt] 
PASS Bug empty template file interrupts forward chain [tests/061.phpt] 
PASS Check for Yaf_View_Simple and application's template directory [tests/062.phpt] 
PASS Check for Yaf_Route_Rewrite with dynamic mvc [tests/063.phpt] 
PASS Check for Yaf_Route_Regex with dynamic mvc [tests/064.phpt] 
PASS Yaf_Route_Regex map is optional [tests/065.phpt] 
PASS Check for Yaf_Route_Regex with abnormal map [tests/066.phpt] 
PASS Check actions map with defined action class [tests/067.phpt] 
PASS Check for multi inheritance of section [tests/068.phpt] 
PASS Fixed bug that alter_response is not binary safe [tests/069.phpt] 
PASS Fixed misleading error message when providing a string in Yaf_Application construction [tests/070.phpt] 
PASS return type in Yaf_Simple_Config::valid() should be boolean [tests/071.phpt] 
PASS check for Yaf_Response_Http::setHeader() and Yaf_Response_Http::getHeader() 
and Yaf_Response_Http::setAllHeaders() and Yaf_Response_Http::clearHeaders() [tests/072.phpt] 
PASS Check for Yaf_Route_Rewrite::assemble [tests/073.phpt] 
PASS Check for Yaf_Route_Simple::assemble [tests/074.phpt] 
PASS Check for Yaf_Route_Regex::assemble [tests/075.phpt] 
PASS Check for Yaf_Route_Supervar::assemble [tests/076.phpt] 
PASS Check for Yaf_Route_Static::assemble [tests/077.phpt] 
PASS Check for Yaf_Route_Map::assemble [tests/078.phpt] 
PASS Autoloading the classes under library [tests/079.phpt] 
PASS PHP7 didn't display Error. [tests/080.phpt] 
PASS PHP7 Yaf_Response leak memory [tests/081.phpt] 
PASS Check for variables out of scope [tests/082.phpt] 
PASS Check for ReturnResponse in cli [tests/083.phpt] 
PASS Check request methods [tests/084.phpt] 
PASS Check Yaf_Request_Http::getRaw [tests/085.phpt] 
PASS Check for Yaf_Response_HTTP::setRedirect in CLI [tests/086.phpt] 
PASS Check for Yaf_Route_Map with arbitrary urls [tests/087.phpt] 
PASS Check for Yaf_Route_Rwrite with arbitrary urls [tests/088.phpt] 
PASS Check for Yaf_Config_Ini gets [tests/089.phpt] 
PASS Check for view path generating [tests/090.phpt] 
PASS Check for Yaf_Request_getXXX [tests/091.phpt] 
PASS Check for base uri detecting [tests/092.phpt] 
PASS Bug #61493 (Can't remove item when using unset() with a Yaf_Config_Simple instance) [tests/bug61493.phpt] 
PASS FR #62702 (Make baseuri case-insensitive) [tests/bug62702.phpt] 
PASS Bug #63381 ($_SERVER['SCRIPT_NAME'] changed by yaf) [tests/bug63381.phpt] 
PASS Bug #63438 (Strange behavior with nested rendering) [tests/bug63438.phpt] 
PASS Bug #63900 (Segfault if separated action executes failed) [tests/bug63900.phpt] 
PASS Bug #70913 (Segfault while new Yaf_Controller) [tests/bug70913.phpt] 
PASS Bug #76213 (Memory leaks with yaf_dispatcher_exception_handler) [tests/bug76213.phpt] 
PASS Bug #76217 (Memory leaks with Yaf_Dispatcher::setDefault*) [tests/bug76217.phpt] 
PASS ISSUE #134 (Segfault while calling assemble) [tests/issue134.phpt] 
PASS Issue #163 (forward from init controller) [tests/issue163.phpt] 
PASS ISSUE #231 (php-fpm worker core dump BUG) [tests/issue231.phpt] 
PASS ISSUE #232 (Segfault with Yaf_Route_Simple) [tests/issue232.phpt] 
PASS ISSUE #303 (local variable is overrided by view renderring) [tests/issue303.phpt] 
PASS ISSUE #311 (Yaf_application::environ should respect $environ) [tests/issue311.phpt] 
PASS Issue #420 (bug in yaf_dispatcher_get_call_parameters) [tests/issue420.phpt] 
FAIL PR #468 Check for sysboml table bug [tests/pr-468.phpt] 
=====================================================================
TIME END 2020-03-24 10:21:12

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   63
---------------------------------------------------------------------

Number of tests :  108               107
Tests skipped   :    1 (  0.9%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    1 (  0.9%) (  0.9%)
Tests passed    :  106 ( 98.1%) ( 99.1%)
---------------------------------------------------------------------
Time taken      :   10 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
PR #468 Check for sysboml table bug [tests/pr-468.phpt]
=====================================================================
PHP 7.4.4 (cli) (built: Mar 23 2020 16:56:12) ( NTS DEBUG )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.4, Copyright (c), by Zend Technologies

@laruence
Copy link
Owner

Ah, I know, where is the problem is... thanks

@laruence laruence merged commit 7214e4b into laruence:master Mar 24, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants