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

4.8.9出现大量段错误 (核心转储) #4712

Closed
shuipf opened this issue May 16, 2022 · 8 comments
Closed

4.8.9出现大量段错误 (核心转储) #4712

shuipf opened this issue May 16, 2022 · 8 comments

Comments

@shuipf
Copy link

shuipf commented May 16, 2022

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.

项目升级到swoole 4.8.9 出现,没做其它特别不一样的

  1. What did you expect to see?

解决这个问题

  1. What did you see instead?

发现了很多core.xxx文件

GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 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...
(No debugging symbols found in php)

warning: core file may not match specified executable file.
[New LWP 17227]
[New LWP 17250]
[New LWP 17249]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `swoole: http serv'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055ab2107012c in zend_exception_error ()
[Current thread is 1 (Thread 0x7fcee09b8980 (LWP 17227))]
(gdb) bt
#0  0x000055ab2107012c in zend_exception_error ()
#1  0x00007fcedd9f07fb in swoole::PHPCoroutine::<lambda()>::operator() (__closure=<optimized out>) at /tmp/pear/temp/swoole/ext-src/swoole_coroutine.cc:340
#2  std::_Function_handler<void(), swoole::PHPCoroutine::catch_exception(zend_object*)::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/9/bits/std_function.h:300
#3  0x00007fcedda3ff46 in std::function<void ()>::operator()() const (this=<optimized out>) at /usr/include/c++/9/bits/std_function.h:683
#4  swoole::Coroutine::check_end (this=<optimized out>) at /tmp/pear/temp/swoole/include/swoole_coroutine.h:243
#5  swoole::Coroutine::check_end (this=<optimized out>) at /tmp/pear/temp/swoole/include/swoole_coroutine.h:238
#6  swoole::Coroutine::run (this=<optimized out>) at /tmp/pear/temp/swoole/include/swoole_coroutine.h:234
#7  swoole::Coroutine::create(std::function<void (void*)> const&, void*) (args=0x7ffc49f74d80, fn=...) at /tmp/pear/temp/swoole/include/swoole_coroutine.h:138
#8  swoole::PHPCoroutine::create (fci_cache=<optimized out>, argc=<optimized out>, argv=<optimized out>) at /tmp/pear/temp/swoole/ext-src/swoole_coroutine.cc:881
#9  0x00007fcedda40044 in zif_swoole_coroutine_create (execute_data=0x7fcee06128e0, return_value=0x7ffc49f74ef0) at /tmp/pear/temp/swoole/ext-src/swoole_coroutine.cc:972
#10 0x000055ab21290815 in execute_ex ()
#11 0x000055ab21219201 in zend_call_function ()
#12 0x000055ab2121963d in zend_call_known_function ()
#13 0x000055ab212ac644 in zend_objects_destroy_object ()
#14 0x000055ab212b0e6f in zend_objects_store_call_destructors ()
#15 0x000055ab2121725b in ?? ()
#16 0x000055ab21226bc5 in zend_call_destructors ()
#17 0x000055ab211c3695 in php_request_shutdown ()
#18 0x000055ab212b7dd3 in ?? ()
#19 0x000055ab210787e8 in ?? ()
#20 0x00007fcee28d5083 in __libc_start_main (main=0x55ab210783e0, argc=3, argv=0x7ffc49f770b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc49f770a8) at ../csu/libc-start.c:308
#21 0x000055ab2107898e in _start ()
  1. What version of Swoole are you using (show your php --ri swoole)?
swoole

Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.8.9
Built => Apr 27 2022 07:26:44
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
openssl => OpenSSL 1.1.1f  31 Mar 2020
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
zlib => 1.2.11
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) ?
    Linux think6-adm-786f54f8f9-5zk72 3.10.0-957.21.3.el7.x86_64 编译出错 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
PHP 8.0.18 (cli) (built: Apr 21 2022 10:14:55) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.18, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.18, Copyright (c), by Zend Technologies

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --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 --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --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-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
@NathanFreeman
Copy link
Member

使用make clean 清理swoole的编译文件之后再编译试试看

@shuipf
Copy link
Author

shuipf commented May 16, 2022

使用make clean 清理swoole的编译文件之后再编译试试看

我是docker镜像,你意思是,我重新编译下镜像吗?

@NathanFreeman
Copy link
Member

用的是官方的php-swoole的docker镜像吗

@shuipf
Copy link
Author

shuipf commented May 16, 2022

用的是官方的php-swoole的docker镜像吗

没有,我一直都是自己的~

RUN printf "no\nyes\nyes\nno\nyes\nyes\n" | pecl install swoole-4.8.9
&& echo "extension=swoole.so" > /etc/php/8.0/mods-available/swoole.ini
&& phpenmod swoole
&& rm -rf /tmp/*

@shuipf
Copy link
Author

shuipf commented May 16, 2022

我切换回4.8.6就没有了~其它没动

@shuipf
Copy link
Author

shuipf commented May 17, 2022

这个就没下文了吗

@matyhtf
Copy link
Member

matyhtf commented May 18, 2022

看样子是在 request shutdown 阶段的对象析构函数__destruct()中又创建了新的协程,并且在此协程中抛出了一个异常。

@matyhtf
Copy link
Member

matyhtf commented May 18, 2022

@shuipf 请添加微信 19921030512 单独沟通吧,我无法重现这个问题

matyhtf added a commit that referenced this issue May 18, 2022
matyhtf added a commit that referenced this issue May 18, 2022
* fix #4712

* optimize code

* optimize code
@matyhtf matyhtf closed this as completed May 18, 2022
matyhtf added a commit that referenced this issue Jun 22, 2022
* fix #4712

* optimize code

* optimize code
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

3 participants