Comments (19)
https://wiki.swoole.com/zh-cn/#/other/tools?id=gdb
https://wiki.swoole.com/zh-cn/#/other/issue?id=关于段错误核心转储
看看能不能通过gdb贴一下程序出现问题的栈堆
from swoole-src.
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 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:
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".
Attaching to process 35353
[New LWP 35357]
[New LWP 35358]
[New LWP 35359]
[New LWP 35360]
[New LWP 35361]
[New LWP 35362]
[New LWP 35363]
[New LWP 35364]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x0000701e81725e2e in epoll_wait (epfd=34, events=0x5a8a6efd1d70, maxevents=4096, timeout=1000) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
30 ../sysdeps/unix/sysv/linux/epoll_wait.c: 没有那个文件或目录.
from swoole-src.
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1 Copyright (C) 2022 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: 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". Attaching to process 35353 [New LWP 35357] [New LWP 35358] [New LWP 35359] [New LWP 35360] [New LWP 35361] [New LWP 35362] [New LWP 35363] [New LWP 35364] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". 0x0000701e81725e2e in epoll_wait (epfd=34, events=0x5a8a6efd1d70, maxevents=4096, timeout=1000) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30 30 ../sysdeps/unix/sysv/linux/epoll_wait.c: 没有那个文件或目录.
这是 gdb -p master进程ID
from swoole-src.
https://wiki.swoole.com/zh-cn/#/other/issue?id=关于段错误核心转储
看看能不能生成core文件,或者把SWOOLE_PROCESS
模式换成SWOOLE_BASE
模式,看看这问题还会不会发生
from swoole-src.
https://wiki.swoole.com/zh-cn/#/other/issue?id=关于段错误核心转储 看看能不能生成core文件,或者把
SWOOLE_PROCESS
模式换成SWOOLE_BASE
模式,看看这问题还会不会发生
改成SWOOLE_BASE错误依旧,生成core文件要重新编译swoole扩展,不过我是通过apt install php8.1-swoole 这种方式安装的,重新编译相同版本的安装就不知道能不能复现了,我可以试试
from swoole-src.
看一下php -m
输出一下扩展列表
from swoole-src.
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
http
iconv
igbinary
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
raphf
readline
redis
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
swoole
sysvmsg
sysvsem
sysvshm
tokenizer
xdebug
xml
xmlreader
xmlwriter
xsl
yaml
Zend OPcache
zip
zlib
[Zend Modules]
Xdebug
Zend OPcache
from swoole-src.
屏蔽掉Xdebug
试试看
from swoole-src.
卸载xdebug就正常了,不是说8.1后xdebug可以用了吗
from swoole-src.
php --ri xdebug
看看xdebug详细信息,swoole5.1
修改过一次跟xdebug有关的bug,可能是新的问题,我要看看
from swoole-src.
xdebug
\ \ / / | | | |
\ V / __| | _| | _ _ __ _
< /
|/ _ \ '_ \| | | |/ _
|
/ . \ (| | / |) | || | (| |
// __,|_|.__/ _,|_, |
/ |
|_/
Version => 3.3.2
Support Xdebug on Patreon, GitHub, or as a business: https://xdebug.org/support
Enabled Features (through 'xdebug.mode' setting)
Feature => Enabled/Disabled
Development Helpers => ✔ enabled
Coverage => ✘ disabled
GC Stats => ✘ disabled
Profiler => ✘ disabled
Step Debugger => ✘ disabled
Tracing => ✘ disabled
Optional Features
Compressed File Support => yes (gzip)
Clock Source => clock_gettime
'xdebug://gateway' pseudo-host support => yes
'xdebug://nameserver' pseudo-host support => yes
Systemd Private Temp Directory => not enabled
Directive => Local Value => Master Value
xdebug.mode => develop => develop
xdebug.start_with_request => default => default
xdebug.start_upon_error => default => default
xdebug.output_dir => /tmp => /tmp
xdebug.use_compression => 1 => 1
xdebug.trigger_value => no value => no value
xdebug.file_link_format => no value => no value
xdebug.filename_format => no value => no value
xdebug.control_socket => time: 25ms => time: 25ms
xdebug.log => no value => no value
xdebug.log_level => 7 => 7
xdebug.var_display_max_children => 128 => 128
xdebug.var_display_max_data => 512 => 512
xdebug.var_display_max_depth => 3 => 3
xdebug.max_nesting_level => 512 => 512
xdebug.cli_color => 0 => 0
xdebug.force_display_errors => Off => Off
xdebug.force_error_reporting => 0 => 0
xdebug.halt_level => 0 => 0
xdebug.max_stack_frames => -1 => -1
xdebug.show_error_trace => Off => Off
xdebug.show_exception_trace => Off => Off
xdebug.show_local_vars => Off => Off
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
xdebug.profiler_append => Off => Off
xdebug.cloud_id => no value => no value
xdebug.client_host => localhost => localhost
xdebug.client_port => 9003 => 9003
xdebug.discover_client_host => Off => Off
xdebug.client_discovery_header => HTTP_X_FORWARDED_FOR,REMOTE_ADDR => HTTP_X_FORWARDED_FOR,REMOTE_ADDR
xdebug.idekey => no value => no value
xdebug.connect_timeout_ms => 200 => 200
xdebug.scream => Off => Off
xdebug.gc_stats_output_name => gcstats.%p => gcstats.%p
xdebug.trace_output_name => trace.%c => trace.%c
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.collect_assignments => Off => Off
xdebug.collect_params => On => On
xdebug.collect_return => Off => Off
xdebug.auto_trace => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.collect_includes => (setting removed in Xdebug 3) => (setting removed in Xdebug 3)
xdebug.collect_vars => (setting removed in Xdebug 3) => (setting removed in Xdebug 3)
xdebug.coverage_enable => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.default_enable => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.gc_stats_enable => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.gc_stats_output_dir => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.overload_var_dump => (setting removed in Xdebug 3) => (setting removed in Xdebug 3)
xdebug.profiler_enable => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.profiler_enable_trigger => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.profiler_enable_trigger_value => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.profiler_output_dir => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.remote_autostart => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.remote_connect_back => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.remote_enable => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.remote_host => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.remote_log => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.remote_log_level => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.remote_mode => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.remote_port => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.remote_timeout => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.show_mem_delta => (setting removed in Xdebug 3) => (setting removed in Xdebug 3)
xdebug.trace_output_dir => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.trace_enable_trigger => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
xdebug.trace_enable_trigger_value => (setting renamed in Xdebug 3) => (setting renamed in Xdebug 3)
from swoole-src.
我没法复现这个问题,看看能不能提供一份最小化代码以供复现
from swoole-src.
from swoole-src.
Sorry for hijacking this thread. I just wanted to share my observation that crashes stop happening for me when I disable the xdebug (3.3.2) extension.
php8.3-swoole5.1.1
When does the crash happen:
The crash, if xdebug is enabled, happens in a task worker which is listening for events on a redis queue (subscribe). Whenever the redis connection is forcibly closed by the redis server (due to inactivity), the task worker crashes and is automatically restarted by swoole.
If xdebug is not enabled, my code is able to handle the close event and create a new redis client & subscribe like intended.
from swoole-src.
@fpysky 我发现是xdebug的max_nesting_level参数设置成了512,如果是某个循环超过512次,就会抛出PHP Fatal error直接终止进程
from swoole-src.
@dhobi I found that the max_nesting_level
parameter of xdebug is set to 512. If a certain loop exceeds 512 times, a PHP Fatal error will be thrown, terminating the process.
from swoole-src.
@NathanFreeman thx for this! What is your proposed fix / workaround here? Simply raise max_nesting_level to a higher number? Would it help if I test it with my "crashing scenario"?
from swoole-src.
I've raised the max_nesting_level in xdebug to 50000, but this bug still happens.
xdebug 3.3.2, xdebug.max_nesting_level => 50000 => 50000
sandbox-sb.6red-swoole8.1 | [2024-05-20 13:05:00 #12.0] WARNING Server::check_worker_exit_status(): worker(pid=60, id=9) abnormal exit, status=0, signal=11
sandbox-sb.6red-swoole8.1 | A bug occurred in Swoole-v5.1.1, please report it.
sandbox-sb.6red-swoole8.1 | The Swoole developers probably don't know about it,
sandbox-sb.6red-swoole8.1 | and unless you report it, chances are it won't be fixed.
sandbox-sb.6red-swoole8.1 | You can read How to report a bug doc before submitting any bug reports:
sandbox-sb.6red-swoole8.1 | >> https://github.com/swoole/swoole-src/blob/master/.github/ISSUE.md
sandbox-sb.6red-swoole8.1 | Please do not send bug reports in the mailing list or personal letters.
sandbox-sb.6red-swoole8.1 | The issue page is also suitable to submit feature requests.
sandbox-sb.6red-swoole8.1 |
sandbox-sb.6red-swoole8.1 | OS: Linux 6.2.0-1012-aws #12~22.04.1-Ubuntu SMP Thu Sep 7 14:01:24 UTC 2023 x86_64
sandbox-sb.6red-swoole8.1 | GCC_VERSION: 11.4.0
sandbox-sb.6red-swoole8.1 | OPENSSL_VERSION: OpenSSL 3.0.2 15 Mar 2022
sandbox-sb.6red-swoole8.1 | PHP_VERSION : 8.1.2-1ubuntu2.17
sandbox-sb.6red-swoole8.1 |
sandbox-sb.6red-swoole8.1 | [2024-05-20T09:05:00.530238-04:00] MWCOM-APP.NOTICE: WorkerErrorListener:closePools (workerId = 9)
from swoole-src.
@dhobi @linuxd3v I don't have a good solution for xdebug. There are too many configurations for xdebug, unless we can find out through the logs which specific configuration is causing PHP to throw a fatal error.
from swoole-src.
Related Issues (20)
- A bug occurred in Swoole-v5.1.2, please report it HOT 26
- PHP Startup Unable to load dynamic library 'swoole' HOT 2
- guzzlehttp在stream=true时,设置超时无效 HOT 5
- 协程被长时间挂起会导致内存大量增加 HOT 49
- windows swoole-cli-v4.8.13-cygwin-x64.zip 在windows上 run(function{}) 内的curl 问题 HOT 2
- 在 Swoole\Coroutine\Http\Server 中的 http server 使用 sendfile 在高并发时会导致 PHP 假死并且内存泄露 HOT 57
- 🪶 在 C++ 中,有提供了Socket sendfile的方法(zerocopy),可以不通过CPU去调度资源,避免重复拷贝两次DMZ(或者更多) HOT 15
- windows swoole-cli-v4.8.13-cygwin-x64 使用协程监听的Channel数据然后插入数据库,插入没几条就报错了! HOT 5
- syntax error near unexpected token `SQLITE,' HOT 4
- @swoole/library/ext/sockets.php(217) E_DEPRECATED:Creation of dynamic property Swoole\Coroutine\Socket::$__ext_sockets_nonblock is deprecated HOT 3
- MACOS M1 SIGRTMIN HOT 2
- swoole:5.1.2-php8.3 - Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. HOT 4
- 编译swoole所用libcurl头文件和PHP 8.3所用版本不同导致Segmentation fault HOT 5
- tracker现在没了吗 HOT 1
- swoole-cli 运行项目时如何使用xlswriter HOT 2
- 面向aop开发 HOT 4
- server.pid file is not created HOT 2
- free(): invalid pointer when curl support is on HOT 10
- Lines to stderr gets tangled
- WebSocket: After calling $webSockerServer->push() from within onMessage event, the WebSocket connection closes by calling onClose event. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swoole-src.