首页
下载
文档
问答社区
视频
捐赠
源代码
AI 助理
赞助商
CRMEB
Apipost
腾讯云
微擎
禅道
51Talk
商业产品
Swoole AI 智能文档翻译器
Swoole-Compiler PHP 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
websocket每天会有几次coredump
### 问题描述 docker里面运行的php, 启用的websocket服务每天会有几次coredump ### Swoole版本,PHP版本,以及操作系统版本信息 php|swoole版本 ``` bash-5.1# bash-5.1# php -v PHP 7.1.12 (cli) (built: Oct 18 2021 19:45:55) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.12, Copyright (c) 1999-2017, by Zend Technologies bash-5.1# bash-5.1# php --ri swoole swoole Swoole => enabled Author => Swoole Team <team@swoole.com> Version => 4.5.7 Built => Oct 18 2021 19:48:52 coroutine => enabled epoll => enabled eventfd => enabled signalfd => enabled spinlock => enabled rwlock => enabled openssl => OpenSSL 1.1.1l 24 Aug 2021 http2 => enabled pcre => enabled zlib => 1.2.11 brotli => E16777225/D16777225 mutex_timedlock => enabled pthread_barrier => 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 bash-5.1# bash-5.1# uname -a Linux 7621fca42672 5.13.13-amd64-desktop #1 SMP Tue Aug 31 18:01:11 CST 2021 x86_64 Linux ``` core信息 ```shell gdb php -c 22 GNU gdb (GDB) 10.1 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-alpine-linux-musl". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://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... warning: Can't open file /dev/zero (deleted) during file-backed mapping note processing [New LWP 22] [New LWP 59] [New LWP 58] [New LWP 60] [New LWP 61] Core was generated by `HB.Worker.5 '. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007fd132c934e1 in swoole::String::reserve (this=0x7ffe5bd752d0, new_size=<optimized out>) at /usr/local/src/swoole-4.5.7/src/core/string.cc:132 132 /usr/local/src/swoole-4.5.7/src/core/string.cc: No such file or directory. [Current thread is 1 (LWP 22)] (gdb) f 0 #0 0x00007fd132c934e1 in swoole::String::reserve (this=0x7ffe5bd752d0, new_size=<optimized out>) at /usr/local/src/swoole-4.5.7/src/core/string.cc:132 132 in /usr/local/src/swoole-4.5.7/src/core/string.cc (gdb) f 1 #1 0x00007fd132c93602 in swoole::String::append (this=this@entry=0x7ffe5bd752d0, append_str=append_str@entry=0x7fd11c6db030 "{\"action\":\"order_helper\",\"order_id\":\"623969924\",\"session_id\":\"2886734015-cc9f579c-4e03-427d-a4e1-3eac64758692\",\"sign\":\"e4a155ee0cbd73faad424752def5d253\",\"timestamp\":\"1640273472\",\"userid\":\"zhw_4hia3lji"..., _length=_length@entry=205) at /usr/local/src/swoole-4.5.7/src/core/string.cc:85 85 in /usr/local/src/swoole-4.5.7/src/core/string.cc (gdb) f 2 #2 0x00007fd132cc76de in swWebSocket_encode (buffer=buffer@entry=0x7ffe5bd752d0, data=0x7fd11c6db030 "{\"action\":\"order_helper\",\"order_id\":\"623969924\",\"session_id\":\"2886734015-cc9f579c-4e03-427d-a4e1-3eac64758692\",\"sign\":\"e4a155ee0cbd73faad424752def5d253\",\"timestamp\":\"1640273472\",\"userid\":\"zhw_4hia3lji"..., length=205, opcode=opcode@entry=10 '\n', _flags=_flags@entry=1 '\001') at /usr/local/src/swoole-4.5.7/src/protocol/websocket.cc:155 155 /usr/local/src/swoole-4.5.7/src/protocol/websocket.cc: No such file or directory. (gdb) bt #0 0x00007fd132c934e1 in swoole::String::reserve (this=0x7ffe5bd752d0, new_size=<optimized out>) at /usr/local/src/swoole-4.5.7/src/core/string.cc:132 #1 0x00007fd132c93602 in swoole::String::append (this=this@entry=0x7ffe5bd752d0, append_str=append_str@entry=0x7fd11c6db030 "{\"action\":\"order_helper\",\"order_id\":\"623969924\",\"session_id\":\"2886734015-cc9f579c-4e03-427d-a4e1-3eac64758692\",\"sign\":\"e4a155ee0cbd73faad424752def5d253\",\"timestamp\":\"1640273472\",\"userid\":\"zhw_4hia3lji"..., _length=_length@entry=205) at /usr/local/src/swoole-4.5.7/src/core/string.cc:85 #2 0x00007fd132cc76de in swWebSocket_encode (buffer=buffer@entry=0x7ffe5bd752d0, data=0x7fd11c6db030 "{\"action\":\"order_helper\",\"order_id\":\"623969924\",\"session_id\":\"2886734015-cc9f579c-4e03-427d-a4e1-3eac64758692\",\"sign\":\"e4a155ee0cbd73faad424752def5d253\",\"timestamp\":\"1640273472\",\"userid\":\"zhw_4hia3lji"..., length=205, opcode=opcode@entry=10 '\n', _flags=_flags@entry=1 '\001') at /usr/local/src/swoole-4.5.7/src/protocol/websocket.cc:155 #3 0x00007fd132c8ccab in swoole_websocket_onMessage (serv=0x7fd125e69680, req=0x7ffe5bd75440) at /usr/local/src/swoole-4.5.7/ext-src/swoole_websocket_server.cc:579 #4 0x00007fd132ce347e in std::function<int (swoole::Server*, swoole::RecvData*)>::operator()(swoole::Server*, swoole::RecvData*) const (__args#1=0x7ffe5bd75440, __args#0=<optimized out>, this=0x7fd125e69bd0) at /usr/include/c++/10.2.1/bits/std_function.h:622 #5 swoole::Worker_do_task (callback=..., task=0x7fd11c6db010, worker=0x7fd12df522b0, serv=0x7fd125e69680) at /usr/local/src/swoole-4.5.7/src/server/worker.cc:219 #6 swoole::Server::accept_task (this=0x7fd125e69680, task=0x7fd11c6db010) at /usr/local/src/swoole-4.5.7/src/server/worker.cc:241 #7 0x00007fd132ce3c41 in swoole::Worker_onPipeReceive (reactor=<optimized out>, event=0x7ffe5bd75590) at /usr/local/src/swoole-4.5.7/src/server/worker.cc:688 #8 0x00007fd132cca8c1 in swoole::ReactorEpoll::wait (this=0x7fd12deae830, timeo=<optimized out>) at /usr/local/src/swoole-4.5.7/src/reactor/epoll.cc:224 #9 0x00007fd132ce4066 in swoole::Reactor::wait (timeout=0x0, this=0x7fd125e06010) at /usr/local/src/swoole-4.5.7/include/swoole_reactor.h:171 #10 swoole::Server::start_event_worker (this=this@entry=0x7fd125e69680, worker=worker@entry=0x7fd12df522b0) at /usr/local/src/swoole-4.5.7/src/server/worker.cc:584 #11 0x00007fd132ccdc3d in swoole::Server::spawn_event_worker (this=0x7fd125e69680, worker=0x7fd12df522b0) at /usr/local/src/swoole-4.5.7/src/server/manager.cc:622 #12 0x00007fd132ccf42d in swoole::Server::start_manager_process (this=this@entry=0x7fd125e69680) at /usr/local/src/swoole-4.5.7/src/server/manager.cc:163 #13 0x00007fd132cd985c in swoole::ProcessFactory::start (this=0x7fd133018850) at /usr/local/src/swoole-4.5.7/src/server/process.cc:134 #14 0x00007fd132cd422a in swoole::Server::start (this=this@entry=0x7fd125e69680) at /usr/local/src/swoole-4.5.7/src/server/master.cc:609 #15 0x00007fd132c7784b in zim_swoole_server_start (execute_data=0x7fd132e13720, return_value=0x7ffe5bd757e0) at /usr/local/src/swoole-4.5.7/ext-src/swoole_server.cc:2646 #16 0x000055f4d768e9f3 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER () at /usr/local/src/php-7.1.12/Zend/zend_vm_execute.h:970 #17 0x000055f4d76401cb in execute_ex (ex=<optimized out>) at /usr/local/src/php-7.1.12/Zend/zend_vm_execute.h:429 #18 0x000055f4d769066f in zend_execute (op_array=op_array@entry=0x7fd132f049a0, return_value=return_value@entry=0x7fd125c33bc0) at /usr/local/src/php-7.1.12/Zend/zend_vm_execute.h:474 #19 0x000055f4d75f95a4 in zend_execute_scripts (type=type@entry=8, retval=0x7fd125c33bc0, retval@entry=0x0, file_count=853619936, file_count@entry=3) at /usr/local/src/php-7.1.12/Zend/zend.c:1482 #20 0x000055f4d7598ea8 in php_execute_script (primary_file=primary_file@entry=0x7ffe5bd77df0) at /usr/local/src/php-7.1.12/main/main.c:2579 #21 0x000055f4d7692a9f in do_cli (argc=5, argv=0x7fd1337f4940) at /usr/local/src/php-7.1.12/sapi/cli/php_cli.c:993 #22 0x000055f4d71e6fd4 in main (argc=5, argv=0x7fd1337f4940) at /usr/local/src/php-7.1.12/sapi/cli/php_cli.c:1381 ``` ### 你期待的结果是什么?实际看到的错误信息又是什么? 请大佬帮忙看看是什么原因引起的coredump
发布于2年前 · 24 次浏览 · 来自
提问
coldlook
### 问题描述 docker里面运行的php, 启用的websocket服务每天会有几次coredump ### Swoole版本,PHP版本,以及操作系统版本信息 php|swoole版本 ``` bash-5.1# bash-5.1# php -v PHP 7.1.12 (cli) (built: Oct 18 2021 19:45:55) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.12, Copyright (c) 1999-2017, by Zend Technologies bash-5.1# bash-5.1# php --ri swoole swoole Swoole => enabled Author => Swoole Team <team@swoole.com> Version => 4.5.7 Built => Oct 18 2021 19:48:52 coroutine => enabled epoll => enabled eventfd => enabled signalfd => enabled spinlock => enabled rwlock => enabled openssl => OpenSSL 1.1.1l 24 Aug 2021 http2 => enabled pcre => enabled zlib => 1.2.11 brotli => E16777225/D16777225 mutex_timedlock => enabled pthread_barrier => 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 bash-5.1# bash-5.1# uname -a Linux 7621fca42672 5.13.13-amd64-desktop #1 SMP Tue Aug 31 18:01:11 CST 2021 x86_64 Linux ``` core信息 ```shell gdb php -c 22 GNU gdb (GDB) 10.1 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-alpine-linux-musl". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://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... warning: Can't open file /dev/zero (deleted) during file-backed mapping note processing [New LWP 22] [New LWP 59] [New LWP 58] [New LWP 60] [New LWP 61] Core was generated by `HB.Worker.5 '. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007fd132c934e1 in swoole::String::reserve (this=0x7ffe5bd752d0, new_size=<optimized out>) at /usr/local/src/swoole-4.5.7/src/core/string.cc:132 132 /usr/local/src/swoole-4.5.7/src/core/string.cc: No such file or directory. [Current thread is 1 (LWP 22)] (gdb) f 0 #0 0x00007fd132c934e1 in swoole::String::reserve (this=0x7ffe5bd752d0, new_size=<optimized out>) at /usr/local/src/swoole-4.5.7/src/core/string.cc:132 132 in /usr/local/src/swoole-4.5.7/src/core/string.cc (gdb) f 1 #1 0x00007fd132c93602 in swoole::String::append (this=this@entry=0x7ffe5bd752d0, append_str=append_str@entry=0x7fd11c6db030 "{\"action\":\"order_helper\",\"order_id\":\"623969924\",\"session_id\":\"2886734015-cc9f579c-4e03-427d-a4e1-3eac64758692\",\"sign\":\"e4a155ee0cbd73faad424752def5d253\",\"timestamp\":\"1640273472\",\"userid\":\"zhw_4hia3lji"..., _length=_length@entry=205) at /usr/local/src/swoole-4.5.7/src/core/string.cc:85 85 in /usr/local/src/swoole-4.5.7/src/core/string.cc (gdb) f 2 #2 0x00007fd132cc76de in swWebSocket_encode (buffer=buffer@entry=0x7ffe5bd752d0, data=0x7fd11c6db030 "{\"action\":\"order_helper\",\"order_id\":\"623969924\",\"session_id\":\"2886734015-cc9f579c-4e03-427d-a4e1-3eac64758692\",\"sign\":\"e4a155ee0cbd73faad424752def5d253\",\"timestamp\":\"1640273472\",\"userid\":\"zhw_4hia3lji"..., length=205, opcode=opcode@entry=10 '\n', _flags=_flags@entry=1 '\001') at /usr/local/src/swoole-4.5.7/src/protocol/websocket.cc:155 155 /usr/local/src/swoole-4.5.7/src/protocol/websocket.cc: No such file or directory. (gdb) bt #0 0x00007fd132c934e1 in swoole::String::reserve (this=0x7ffe5bd752d0, new_size=<optimized out>) at /usr/local/src/swoole-4.5.7/src/core/string.cc:132 #1 0x00007fd132c93602 in swoole::String::append (this=this@entry=0x7ffe5bd752d0, append_str=append_str@entry=0x7fd11c6db030 "{\"action\":\"order_helper\",\"order_id\":\"623969924\",\"session_id\":\"2886734015-cc9f579c-4e03-427d-a4e1-3eac64758692\",\"sign\":\"e4a155ee0cbd73faad424752def5d253\",\"timestamp\":\"1640273472\",\"userid\":\"zhw_4hia3lji"..., _length=_length@entry=205) at /usr/local/src/swoole-4.5.7/src/core/string.cc:85 #2 0x00007fd132cc76de in swWebSocket_encode (buffer=buffer@entry=0x7ffe5bd752d0, data=0x7fd11c6db030 "{\"action\":\"order_helper\",\"order_id\":\"623969924\",\"session_id\":\"2886734015-cc9f579c-4e03-427d-a4e1-3eac64758692\",\"sign\":\"e4a155ee0cbd73faad424752def5d253\",\"timestamp\":\"1640273472\",\"userid\":\"zhw_4hia3lji"..., length=205, opcode=opcode@entry=10 '\n', _flags=_flags@entry=1 '\001') at /usr/local/src/swoole-4.5.7/src/protocol/websocket.cc:155 #3 0x00007fd132c8ccab in swoole_websocket_onMessage (serv=0x7fd125e69680, req=0x7ffe5bd75440) at /usr/local/src/swoole-4.5.7/ext-src/swoole_websocket_server.cc:579 #4 0x00007fd132ce347e in std::function<int (swoole::Server*, swoole::RecvData*)>::operator()(swoole::Server*, swoole::RecvData*) const (__args#1=0x7ffe5bd75440, __args#0=<optimized out>, this=0x7fd125e69bd0) at /usr/include/c++/10.2.1/bits/std_function.h:622 #5 swoole::Worker_do_task (callback=..., task=0x7fd11c6db010, worker=0x7fd12df522b0, serv=0x7fd125e69680) at /usr/local/src/swoole-4.5.7/src/server/worker.cc:219 #6 swoole::Server::accept_task (this=0x7fd125e69680, task=0x7fd11c6db010) at /usr/local/src/swoole-4.5.7/src/server/worker.cc:241 #7 0x00007fd132ce3c41 in swoole::Worker_onPipeReceive (reactor=<optimized out>, event=0x7ffe5bd75590) at /usr/local/src/swoole-4.5.7/src/server/worker.cc:688 #8 0x00007fd132cca8c1 in swoole::ReactorEpoll::wait (this=0x7fd12deae830, timeo=<optimized out>) at /usr/local/src/swoole-4.5.7/src/reactor/epoll.cc:224 #9 0x00007fd132ce4066 in swoole::Reactor::wait (timeout=0x0, this=0x7fd125e06010) at /usr/local/src/swoole-4.5.7/include/swoole_reactor.h:171 #10 swoole::Server::start_event_worker (this=this@entry=0x7fd125e69680, worker=worker@entry=0x7fd12df522b0) at /usr/local/src/swoole-4.5.7/src/server/worker.cc:584 #11 0x00007fd132ccdc3d in swoole::Server::spawn_event_worker (this=0x7fd125e69680, worker=0x7fd12df522b0) at /usr/local/src/swoole-4.5.7/src/server/manager.cc:622 #12 0x00007fd132ccf42d in swoole::Server::start_manager_process (this=this@entry=0x7fd125e69680) at /usr/local/src/swoole-4.5.7/src/server/manager.cc:163 #13 0x00007fd132cd985c in swoole::ProcessFactory::start (this=0x7fd133018850) at /usr/local/src/swoole-4.5.7/src/server/process.cc:134 #14 0x00007fd132cd422a in swoole::Server::start (this=this@entry=0x7fd125e69680) at /usr/local/src/swoole-4.5.7/src/server/master.cc:609 #15 0x00007fd132c7784b in zim_swoole_server_start (execute_data=0x7fd132e13720, return_value=0x7ffe5bd757e0) at /usr/local/src/swoole-4.5.7/ext-src/swoole_server.cc:2646 #16 0x000055f4d768e9f3 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER () at /usr/local/src/php-7.1.12/Zend/zend_vm_execute.h:970 #17 0x000055f4d76401cb in execute_ex (ex=<optimized out>) at /usr/local/src/php-7.1.12/Zend/zend_vm_execute.h:429 #18 0x000055f4d769066f in zend_execute (op_array=op_array@entry=0x7fd132f049a0, return_value=return_value@entry=0x7fd125c33bc0) at /usr/local/src/php-7.1.12/Zend/zend_vm_execute.h:474 #19 0x000055f4d75f95a4 in zend_execute_scripts (type=type@entry=8, retval=0x7fd125c33bc0, retval@entry=0x0, file_count=853619936, file_count@entry=3) at /usr/local/src/php-7.1.12/Zend/zend.c:1482 #20 0x000055f4d7598ea8 in php_execute_script (primary_file=primary_file@entry=0x7ffe5bd77df0) at /usr/local/src/php-7.1.12/main/main.c:2579 #21 0x000055f4d7692a9f in do_cli (argc=5, argv=0x7fd1337f4940) at /usr/local/src/php-7.1.12/sapi/cli/php_cli.c:993 #22 0x000055f4d71e6fd4 in main (argc=5, argv=0x7fd1337f4940) at /usr/local/src/php-7.1.12/sapi/cli/php_cli.c:1381 ``` ### 你期待的结果是什么?实际看到的错误信息又是什么? 请大佬帮忙看看是什么原因引起的coredump
赞
0
分享
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
评论
2021-12-28
鲁飞
先升级到v4.8.5后观察是否复现
赞
0
回复
微信公众号
热门内容
暂无回复的问答
- CodeGalaxy K3s 轻量集群节点之间如何实现负载均衡
- 关于openssl CURL WARNING swSSL_connect: SSL_connect(fd=69) failed. Error: error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small[1|394]
- 多个模型如何进行事务异常回退?
- websocket开启wss报错
- 协程tcp服务器如何使用多进程?recv()方法接收信息,打印出来的pid一直是同一个。没用使用到多进程啊。