swoole / swoole-src

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

Error: Using Xdebug in coroutines is extremely dangerous #4487

Closed lucassmacedo closed 2 years ago

lucassmacedo commented 3 years ago

Please answer these questions before submitting your issue. Thanks!

PHP Warning: Swoole\Coroutine\Scheduler::start(): Using Xdebug in coroutines is extremely dangerous, please notice that it may lead to coredump! in @swoole-src/library/core/Coroutine/functions.php on line 18

  1. What did you do? If possible, provide a simple script for reproducing the error. Only enable Swoole + Xdebug

What version of Swoole are you using (show your php --ri swoole)? Version => 4.8.1

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

Linux 7edc46eeace2 5.11.0-40-generic #44~20.04.2-Ubuntu SMP Tue Oct 26 18:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux PHP 8.0.12 (cli) (built: Oct 22 2021 12:35:27) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.12, Copyright (c) Zend Technologies with Zend OPcache v8.0.12, Copyright (c), by Zend Technologies with Xdebug v3.1.1, Copyright (c) 2002-2021, by Derick Rethans [1]+ Done uname -a Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 10.3.0-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --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-bootstrap --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 --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-10-gDeRY6/gcc-10-10.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-gDeRY6/gcc-10-10.3.0/debian/tmp-gcn/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1)

NathanFreeman commented 3 years ago

Xdebug has many global variables. You can use yasd instead of Xdebug.

lucassmacedo commented 3 years ago

Thanks. I have disabled the XDebug and it works

matyhtf commented 2 years ago

This is a warning, xdebug may be incompatible with swoole. When swoole is switching coroutines, xdebug may have a memory error