swoole / swoole-src

🚀 Coroutine-based concurrency library for PHP
https://www.swoole.com
Apache License 2.0
18.42k stars 3.16k forks source link

swoole 5.0.3 报错建议提交, ubuntu 23.04 #5075

Closed WongYueKeung closed 1 year ago

WongYueKeung commented 1 year ago

[2023-06-23 01:19:09 #6401.0] WARNING ProcessPool::wait(): worker#6 abnormal exit, status=0, signal=11 A bug occurred in Swoole-v5.0.3, please report it. The Swoole developers probably don't know about it, and unless you report it, chances are it won't be fixed. You can read How to report a bug doc before submitting any bug reports:

https://github.com/swoole/swoole-src/blob/master/.github/ISSUE.md Please do not send bug reports in the mailing list or personal letters. The issue page is also suitable to submit feature requests.

OS: Linux 6.2.0-23-generic #23-Ubuntu SMP PREEMPT_DYNAMIC Wed May 17 16:55:20 UTC 2023 x86_64 GCC_VERSION: 12.2.0 PHP_VERSION : 8.1.12-1ubuntu4

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error. 我用think-swoole跑自己的项目(用swoole4.8就写好了的),换成swoole5之前没出现这个错误,确定不了会触发这个问题的场景,感觉挺随机的,偶尔会弹不固定,想复现也复现不了,印这个错误的时候ubuntu会卡一会弹提交错误里面看到和swoole process相关。暂时未知原因,我看能不能系统日志找到就发评评论里

  2. What did you expect to see?

  3. What did you see instead?

  4. What version of Swoole are you using (show your php --ri swoole)? $ php --ri swoole

swoole

Swoole => enabled Author => Swoole Team team@swoole.com Version => 5.0.3 Built => Jun 19 2023 14:56:36 coroutine => enabled with boost asm context epoll => enabled eventfd => enabled signalfd => enabled cpu_affinity => enabled spinlock => enabled rwlock => enabled http2 => enabled json => enabled mutex_timedlock => enabled pthread_barrier => enabled futex => enabled async_redis => enabled

Directive => Local Value => Master Value swoole.enable_coroutine => On => On swoole.enable_library => On => On swoole.enable_preemptive_scheduler => Off => Off swoole.display_errors => On => On swoole.use_shortname => On => On swoole.unixsock_buffer_size => 8388608 => 8388608

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ? $uname -a Linux mikehuang0755-23.04 6.2.0-23-generic #23-Ubuntu SMP PREEMPT_DYNAMIC Wed May 17 16:55:20 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

$php -v PHP 8.1.12-1ubuntu4 (cli) (built: Feb 22 2023 19:48:21) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.12, Copyright (c) Zend Technologies with Zend OPcache v8.1.12-1ubuntu4, Copyright (c), by Zend Technologies with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans

$gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 12.2.0-17ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-Pa930Z/gcc-12-12.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-Pa930Z/gcc-12-12.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.2.0 (Ubuntu 12.2.0-17ubuntu1)

WongYueKeung commented 1 year ago

把ubuntu crash导出来了,应该是xdebug扩展搞得,文档里说了swoole5可以开启xdebug的呀,而且xdebug是可以运作的,但是过段时间就会把ubuntu搞卡死,不定的 老大辛苦看下 在我的分享的gist,开头就看到了。 swoole 版本5.0.3 https://gist.github.com/WongYueKeung/3bfa65aedcf36fd116e419d3b0455f2c

NathanFreeman commented 1 year ago

你这个可以贴一下贴图吗,你这个连接我打不开

WongYueKeung commented 1 year ago

你这个可以贴一下贴图吗,你这个连接我打不开

你能打的开github就能打的开github的gist呀,文档说可以用xdebug,是不是只有指定的xdebug版本才能用? 还需要什么信息就和我说 SegvAnalysis: Segfault happened at: 0x7fa57ca70b2c <xdebug_fiber_switch_observer+332>: testb $0x40,0x4(%rax) PC (0x7fa57ca70b2c) ok source "$0x40" ok destination "0x4(%rax)" (0x00000004) not located in a known VMA region (needed writable region)! Stack memory exhausted (SP below stack segment) SegvReason: writing NULL VMA Stacktrace:

0 zend_string_copy (s=0x0) at /usr/include/php/20210902/Zend/zend_string.h:192

No locals.

1 add_fiber_main (fiber=) at /usr/src/xdebug-3.2.0+3.1.6+2.9.8+2.8.1+2.5.5-3/build-8.1/src/base/base.c:1107

     key = 0x55f210bd99b0
     tmp = 0x55f21142e8b0
     key = <optimized out>
     tmp = <optimized out>

2 xdebug_fiber_switch_observer (from=, to=) at /usr/src/xdebug-3.2.0+3.1.6+2.9.8+2.8.1+2.5.5-3/build-8.1/src/base/base.c:1168

     current_stack = <optimized out>

3 0x000055f20f0e7a09 in zend_observer_fiber_switch_notify ()

No symbol table info available.

4 0x00007fa5790c62c0 in swoole::PHPCoroutine::fiber_context_switch_notify (from=, to=0x7fa553ec6030) at /home/mikehuang0755/Downloads/swoole-src-5.0.3/ext-src/swoole_coroutine.cc:881

     from_context = 0x7fa576ce6d80
     to_context = 0x7fa576ce6360

5 0x00007fa5790c630d in swoole::PHPCoroutine::fiber_context_switch_try_notify (from=, to=) at /home/mikehuang0755/Downloads/swoole-src-5.0.3/ext-src/swoole_coroutine.cc:894

No locals.

6 0x00007fa5790c6578 in swoole::PHPCoroutine::on_close (arg=0x7fa553ef9030) at /home/mikehuang0755/Downloads/swoole-src-5.0.3/ext-src/swoole_coroutine.cc:587

     task = <optimized out>
     origin_task = 0x7fa553ec6030

7 0x00007fa579159bbf in swoole::Coroutine::close (this=0x55f21167cb20) at /home/mikehuang0755/Downloads/swoole-src-5.0.3/src/coroutine/base.cc:138

No locals.

8 0x00007fa5790c9368 in swoole::Coroutine::check_end (this=0x55f21167cb20) at /home/mikehuang0755/Downloads/swoole-src-5.0.3/include/swoole_coroutine.h:290

No locals.

9 swoole::Coroutine::run (this=0x55f21167cb20) at /home/mikehuang0755/Downloads/swoole-src-5.0.3/include/swoole_coroutine.h:284

     cid = <optimized out>
     cid = <optimized out>

10 swoole::Coroutine::create(std::function<void (void)> const&, void) (fn=..., args=args@entry=0x55f21142e070) at /home/mikehuang0755/Downloads/swoole-src-5.0.3/include/swoole_coroutine.h:158

No locals.

11 0x00007fa5790c864d in swoole::PHPCoroutine::create (fci_cache=fci_cache@entry=0x55f21142e0f0, argc=, argv=0x7fa553ec6430) at /home/mikehuang0755/Downloads/swoole-src-5.0.3/ext-src/swoole_coroutine.cc:806

     type = <optimized out>
     _args = {fci_cache = 0x55f21142e0f0, argv = 0x7fa553ec6430, argc = 1}

12 0x00007fa5790c8773 in zif_swoole_coroutine_create (execute_data=0x7fa553ec63d0, return_value=0x55f21142e210) at /home/mikehuang0755/Downloads/swoole-src-5.0.3/ext-src/swoole_coroutine.cc:971

     fci = {size = 64, function_name = {value = {lval = 140348597606016, dval = 6.9341420519129524e-310, counted = 0x7fa5744e1680, str = 0x7fa5744e1680, arr = 0x7fa5744e1680, obj = 0x7fa5744e1680, res = 0x7fa5744e1680, ref = 0x7fa5744e1680, ast = 0x7fa5744e1680, zv = 0x7fa5744e1680, ptr = 0x7fa5744e1680, ce = 0x7fa5744e1680, func = 0x7fa5744e1680, ww = {w1 = 1951274624, w2 = 32677}}, u1 = {type_info = 776, v = {type = 8 '\b', type_flags = 3 '\003', u = {extra = 0}}}, u2 = {next = 22002, cache_slot = 22002, opline_num = 22002, lineno = 22002, num_args = 22002, fe_pos = 22002, fe_iter_idx = 22002, property_guard = 22002, constant_flags = 22002, extra = 22002}}, retval = 0x0, params = 0x7fa553ec6430, object = 0x7fa576afc9a0, param_count = 1, named_params = 0x0}
     fci_cache = {function_handler = 0x7fa5744e16b8, calling_scope = 0x7fa576b054b8, called_scope = 0x7fa576b054b8, object = 0x7fa576afc9a0}
     cid = <optimized out>

13 0x00007fa57ca73075 in xdebug_execute_internal (current_execute_data=0x7fa553ec63d0, return_value=0x55f21142e210) at /usr/src/xdebug-3.2.0+3.1.6+2.9.8+2.8.1+2.5.5-3/build-8.1/src/base/base.c:952

     edata = <optimized out>
     fse = 0x55f210c18e80
     function_nr = 111067
     function_call_traced = 0
     restore_error_handler_situation = 0
     tmp_error_cb = 0x0

14 0x000055f20f0bbbcb in execute_ex ()

No symbol table info available.

15 0x00007fa57ca7336e in xdebug_execute_ex (execute_data=0x7fa553ec62e0) at /usr/src/xdebug-3.2.0+3.1.6+2.9.8+2.8.1+2.5.5-3/build-8.1/src/base/base.c:830

     op_array = 0x7fa576b6a9d8
     edata = <optimized out>
     fse = 0x55f210c18db0
     function_nr = 111065
     code_coverage_function_name = 0x0
     code_coverage_filename = 0x0
     code_coverage_init = 0

16 0x000055f20f0bebe7 in execute_ex ()

No symbol table info available.

NathanFreeman commented 1 year ago

master分支有修复过一个关于xdehug的补丁 https://github.com/swoole/swoole-src/commit/fe73b8cc9a50b67fcc243f8d24c81ba68f345a9a

matyhtf commented 1 year ago

试试使用最新的 master 分支代码,另外 xdebug 也升级一下