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

PHP7+Nginx+Yaf报Segmentation fault (core dumped)错误 #220

Closed
karsonzhang opened this issue Dec 9, 2015 · 7 comments
Closed

PHP7+Nginx+Yaf报Segmentation fault (core dumped)错误 #220

karsonzhang opened this issue Dec 9, 2015 · 7 comments

Comments

@karsonzhang
Copy link

Cli下报(core dumped)错误,fpm下直接502错误

_request->getRequestUri(),"\n"; //return FALSE; //加上这行不会产生错误 } ``` } root@ubuntu14:/mnt/hgfs/project/sg-area# php /mnt/hgfs/project/sg-area/cli.php request_uri=/index/test request uri:index/test Segmentation fault (core dumped) root@ubuntu14:/mnt/hgfs/project/sg-area# gdb php core GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Copyright (C) 2014 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". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from php...done. [New LWP 2457] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `php /mnt/hgfs/project/sg-area/cli.php request_uri=/index/test'. Program terminated with signal SIGSEGV, Segmentation fault. #0 zend_std_read_property (object=, member=0x7ffcc84c39d0, type=3, cache_slot=, rv=0x0) at /root/packages/php-7.0.0/Zend/zend_object_handlers.c:517 517 zval _zend_std_read_property(zval *object, zval *member, int type, void *_cache_slot, zval _rv) /_ {{{ */ (gdb) source ~/packages/php-7.0.0/.gdbinit (gdb) zbacktrace [0x7fbb8fc141e0] Yaf_Dispatcher->dispatch(object[0x7fbb8fc14240]) [internal function] [0x7fbb8fc14030](main) /mnt/hgfs/project/sg-area/cli.php:11 (gdb)
@laruence
Copy link
Owner

laruence commented Dec 9, 2015

你把整个backtrace贴出来(不是zbacktrace)

@karsonzhang
Copy link
Author

(gdb) source ~/packages/php-7.0.0/.gdbinit
(gdb) backtrace
#0 zend_std_read_property (object=, member=0x7ffcc84c39d0, type=3, cache_slot=, rv=0x0) at /root/packages/php-7.0.0/Zend/zend_object_handlers.c:517
#1 0x000000000080b974 in zend_read_property (scope=scope@entry=0x7fbb8fc0d2e0, object=object@entry=0x7ffcc84c3ab0, name=name@entry=0x7fbb8f585ad3 "yafAutoRender", name_length=name_length@entry=13, silent=silent@entry=1 '\001', rv=rv@entry=0x0)
at /root/packages/php-7.0.0/Zend/zend_API.c:4006
#2 0x00007fbb8f5689de in yaf_dispatcher_handle (dispatcher=dispatcher@entry=0x7fbb8fc14200, request=request@entry=0x7fbb8fc7e208, response=response@entry=0x7ffcc84c3be0, view=view@entry=0x7ffcc84c3b70) at /root/packages/yaf-yaf-3.0.0/yaf_dispatcher.c:671
#3 0x00007fbb8f569c68 in yaf_dispatcher_dispatch (dispatcher=dispatcher@entry=0x7fbb8fc14200, response_ptr=response_ptr@entry=0x7ffcc84c3be0) at /root/packages/yaf-yaf-3.0.0/yaf_dispatcher.c:873
#4 0x00007fbb8f56a50b in zim_yaf_dispatcher_dispatch (execute_data=, return_value=0x7fbb8fc141c0) at /root/packages/yaf-yaf-3.0.0/yaf_dispatcher.c:1121
#5 0x000000000087a32b in ZEND_DO_FCALL_SPEC_HANDLER () at /root/packages/php-7.0.0/Zend/zend_vm_execute.h:842
#6 0x000000000083d24b in execute_ex (ex=) at /root/packages/php-7.0.0/Zend/zend_vm_execute.h:414
#7 0x0000000000885e17 in zend_execute (op_array=0x7fbb8fc7e000, op_array@entry=0x7fbb8fc64ac0, return_value=return_value@entry=0x7fbb8fc14030) at /root/packages/php-7.0.0/Zend/zend_vm_execute.h:458
#8 0x0000000000801d24 in zend_execute_scripts (type=type@entry=8, retval=0x7fbb8fc14030, retval@entry=0x0, file_count=file_count@entry=3) at /root/packages/php-7.0.0/Zend/zend.c:1428
#9 0x00000000007a6118 in php_execute_script (primary_file=primary_file@entry=0x7ffcc84c60b0) at /root/packages/php-7.0.0/main/main.c:2471
#10 0x00000000008879e3 in do_cli (argc=3, argv=0x15d8a40) at /root/packages/php-7.0.0/sapi/cli/php_cli.c:974
#11 0x0000000000440410 in main (argc=3, argv=0x15d8a40) at /root/packages/php-7.0.0/sapi/cli/php_cli.c:1345

@laruence
Copy link
Owner

laruence commented Dec 9, 2015

it should be fixed, please have a check.

@karsonzhang
Copy link
Author

@laruence 我先试试,谢谢!

@karsonzhang
Copy link
Author

@laruence 不会产生Segmentation fault这个问题了,fpm下也不会报错了,但现在不能自动渲染模板了,Yaf_Dispatcher::getInstance()->autoRender(TRUE);试了不行,protected $yafAutoRender = 1;同样不行。testAction没有加return FALSE;

@laruence
Copy link
Owner

laruence commented Dec 9, 2015

你再测试下, 我刚刚提交了个小修复

@karsonzhang
Copy link
Author

@laruence 测试OK,谢谢!

@laruence laruence closed this as completed Jan 8, 2018
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