Skip to content

A bug occurred in Swoole-v6.0.2 #5751

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

Open
godfreybwaira opened this issue May 6, 2025 · 9 comments
Open

A bug occurred in Swoole-v6.0.2 #5751

godfreybwaira opened this issue May 6, 2025 · 9 comments

Comments

@godfreybwaira
Copy link

I was running a swoole application on my local server, when I received a request i.e $server->on('request', ...) my application crashed due to internal error, then I got these stuffs...

WARNING Worker::report_error(): worker(pid=15163, id=2) abnormal exit, status=0, signal=11
A bug occurred in Swoole-v6.0.2, 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 5.15.0-139-generic #149~20.04.1-Ubuntu SMP Wed Apr 16 08:29:56 UTC 2025 x86_64
GCC_VERSION: 9.4.0
OPENSSL_VERSION: OpenSSL 1.1.1f 31 Mar 2020
PHP_VERSION : 8.4.5

@NathanFreeman
Copy link
Member

please show me your php extensions.
php -m

@godfreybwaira
Copy link
Author

[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
random
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
swoole
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
yaml
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

@NathanFreeman
Copy link
Member

Please use Valgrind to check for issues in the program.
https://wiki.swoole.com/en/#/other/issue?id=memory-analysis-highly-recommended

@godfreybwaira
Copy link
Author

==18598== Memcheck, a memory error detector
==18598== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==18598== Using Valgrind-3.25.0 and LibVEX; rerun with -h for copyright info
==18598== Command: php index.php
==18598== Parent PID: 14218
==18598==
==18638== Warning: client switching stacks? SP change: 0x1ffeffbaf8 --> 0xc8c9b08
==18638== to suppress, use: --max-stackframe=137211617264 or greater
==18638== Warning: client switching stacks? SP change: 0xc8c9ad8 --> 0x1ffeffbaf8
==18638== to suppress, use: --max-stackframe=137211617312 or greater
==18638== Warning: client switching stacks? SP change: 0x1ffeffb528 --> 0xcea1ff8
==18638== to suppress, use: --max-stackframe=137205486896 or greater
==18638== further instances of this message will not be shown.
==18638== Invalid read of size 8
==18638== at 0xA22F31E: swoole::PHPCoroutine::create_context(swoole::PHPCoroutine::Args*) (in /usr/lib/php/20240924/swoole.so)
==18638== by 0xA23036A: swoole::PHPCoroutine::main_func(void*) (in /usr/lib/php/20240924/swoole.so)
==18638== by 0xA255D67: swoole::coroutine::Context::context_func(transfer_t) (in /usr/lib/php/20240924/swoole.so)
==18638== by 0xA2FA6D6: swoole_make_fcontext (in /usr/lib/php/20240924/swoole.so)
==18638== Address 0x18 is not stack'd, malloc'd or (recently) free'd
==18638==
==18638==
==18638== Process terminating with default action of signal 11 (SIGSEGV)
==18638== Access not within mapped region at address 0x18
==18638== at 0xA22F31E: swoole::PHPCoroutine::create_context(swoole::PHPCoroutine::Args*) (in /usr/lib/php/20240924/swoole.so)
==18638== by 0xA23036A: swoole::PHPCoroutine::main_func(void*) (in /usr/lib/php/20240924/swoole.so)
==18638== by 0xA255D67: swoole::coroutine::Context::context_func(transfer_t) (in /usr/lib/php/20240924/swoole.so)
==18638== by 0xA2FA6D6: swoole_make_fcontext (in /usr/lib/php/20240924/swoole.so)
==18638== If you believe this happened as a result of a stack
==18638== overflow in your program's main thread (unlikely but
==18638== possible), you can try to increase the size of the
==18638== main thread stack using the --main-stacksize= flag.
==18638== The main thread stack size used in this run was 8388608.
==18638==
==18638== HEAP SUMMARY:
==18638== in use at exit: 11,280,625 bytes in 42,864 blocks
==18638== total heap usage: 74,621 allocs, 31,757 frees, 25,000,193 bytes allocated
==18638==
==18638== LEAK SUMMARY:
==18638== definitely lost: 49,813 bytes in 1,302 blocks
==18638== indirectly lost: 40 bytes in 1 blocks
==18638== possibly lost: 3,695,167 bytes in 22,981 blocks
==18638== still reachable: 7,519,047 bytes in 18,579 blocks
==18638== suppressed: 16,558 bytes in 1 blocks
==18638== Rerun with --leak-check=full to see details of leaked memory
==18638==
==18638== For lists of detected and suppressed errors, rerun with: -s
==18638== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

@NathanFreeman
Copy link
Member

Execute the following commands and share their outputs:
php --ri swoole
php --ri curl
php --ri openssl

Also, try disabling the opcache extension to see if that resolves the issue.

@godfreybwaira
Copy link
Author

I know how to reproduce the error. It occurs when accessing undeclared variable.

@godfreybwaira
Copy link
Author

php --ri swoole

swoole

Swoole => enabled
Author => Swoole Team [email protected]
Version => 6.0.2
Built => Apr 7 2025 19:59:48
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 1.1.1f 31 Mar 2020
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
curl-version => 7.68.0
c-ares => 1.15.0
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled
coroutine_pgsql => enabled
coroutine_sqlite => enabled

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

@godfreybwaira
Copy link
Author

php --ri curl

curl

cURL support => enabled
cURL Information => 7.68.0
Age => 5
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => Yes
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => Yes
SPNEGO => Yes
SSL => Yes
SSPI => No
TLS-SRP => Yes
HTTP2 => Yes
GSSAPI => Yes
KERBEROS5 => Yes
UNIX_SOCKETS => Yes
PSL => Yes
HTTPS_PROXY => Yes
MULTI_SSL => No
BROTLI => Yes
ALTSVC => No
HTTP3 => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Host => x86_64-pc-linux-gnu
SSL Version => OpenSSL/1.1.1f
ZLib Version => 1.2.11
libSSH Version => libssh/0.9.3/openssl/zlib

Directive => Local Value => Master Value
curl.cainfo => no value => no value

@godfreybwaira
Copy link
Author

php --ri openssl

openssl

OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.1.1f 31 Mar 2020
OpenSSL Header Version => OpenSSL 1.1.1f 31 Mar 2020
Openssl default config => /usr/lib/ssl/openssl.cnf

Directive => Local Value => Master Value
openssl.cafile => no value => no value
openssl.capath => no value => no value

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