swoole-src: swoole 4.6.0-alpha cURL [FATAL ERROR] all coroutines (count: 1) are asleep - deadlock!
Please answer these questions before submitting your issue. Thanks!
- What did you do? If possible, provide a simple script for reproducing the error.
$app = Factory::miniProgram($this->wechatMiniConfig);
$app['cache'] = ApplicationContext::getContainer()->get(CacheInterface::class);
return $app;
$response = $app->app_code->get($path);
if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {
$content = $response->getBodyContents();
$path = $this->aliYunOSS->upload($content, 'png');
if ($path) {
return $this->success([
'url' => $path,
]);
}
}
upload
public function upload($file, Filesystem $factory) {
$factory->put('/bar.txt', $file);
}
- What did you expect to see?
Solve the problem
- What did you see instead?
===================================================================
[FATAL ERROR]: all coroutines (count: 1) are asleep - deadlock!
===================================================================
[Coroutine-8]
--------------------------------------------------------------------
#0 Swoole\Coroutine::printBackTrace() called at [@swoole-src/library/core/Coroutine/functions.php:74]
#1 Swoole\Coroutine\deadlock_check()
#2 curl_getinfo() called at [/mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php:492]
#3 OSS\Http\RequestCore->streaming_header_callback()
#4 curl_exec() called at [/mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php:844]
#5 OSS\Http\RequestCore->send_request() called at [/mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php:2960]
#6 OSS\OssClient->auth() called at [/mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php:2050]
#7 OSS\OssClient->doesObjectExist() called at [/mnt/c/code/php/gold-pet/vendor/xxtime/flysystem-aliyun-oss/src/OssAdapter.php:251]
#8 Xxtime\Flysystem\Aliyun\OssAdapter->has() called at [/mnt/c/code/php/gold-pet/vendor/league/flysystem/src/Filesystem.php:57]
#9 League\Flysystem\Filesystem->has() called at [/mnt/c/code/php/gold-pet/vendor/league/flysystem/src/Filesystem.php:98]
#10 League\Flysystem\Filesystem->put() called at [/mnt/c/code/php/gold-pet/runtime/container/proxy/App_Pet_Kernel_Utools_AliyunOSS.proxy.php:57]
#11 App\Pet\Kernel\Utools\AliyunOSS->upload() called at [/mnt/c/code/php/gold-pet/runtime/container/proxy/App_Pet_Controller_AdoptsController.proxy.php:146]
#12 App\Pet\Controller\AdoptsController->getCode() called at [/mnt/c/code/php/gold-pet/vendor/hyperf/http-server/src/CoreMiddleware.php:161]
#13 Hyperf\HttpServer\CoreMiddleware->handleFound() called at [/mnt/c/code/php/gold-pet/vendor/hyperf/http-server/src/CoreMiddleware.php:113]
#14 Hyperf\HttpServer\CoreMiddleware->process() called at [/mnt/c/code/php/gold-pet/vendor/hyperf/dispatcher/src/AbstractRequestHandler.php:65]
#15 Hyperf\Dispatcher\AbstractRequestHandler->handleRequest() called at [/mnt/c/code/php/gold-pet/vendor/hyperf/dispatcher/src/HttpRequestHandler.php:26]
#16 Hyperf\Dispatcher\HttpRequestHandler->handle() called at [/mnt/c/code/php/gold-pet/app/Pet/Middleware/UserAuthMiddleware.php:39]
#17 App\Pet\Middleware\UserAuthMiddleware->process() called at [/mnt/c/code/php/gold-pet/vendor/hyperf/dispatcher/src/AbstractRequestHandler.php:65]
#18 Hyperf\Dispatcher\AbstractRequestHandler->handleRequest() called at [/mnt/c/code/php/gold-pet/vendor/hyperf/dispatcher/src/HttpRequestHandler.php:26]
#19 Hyperf\Dispatcher\HttpRequestHandler->handle() called at [/mnt/c/code/php/gold-pet/vendor/hyperf/validation/src/Middleware/ValidationMiddleware.php:81]
#20 Hyperf\Validation\Middleware\ValidationMiddleware->process() called at [/mnt/c/code/php/gold-pet/vendor/hyperf/dispatcher/src/AbstractRequestHandler.php:65]
#21 Hyperf\Dispatcher\AbstractRequestHandler->handleRequest() called at [/mnt/c/code/php/gold-pet/vendor/hyperf/dispatcher/src/HttpRequestHandler.php:26]
#22 Hyperf\Dispatcher\HttpRequestHandler->handle() called at [/mnt/c/code/php/gold-pet/vendor/hyperf/dispatcher/src/HttpDispatcher.php:40]
#23 Hyperf\Dispatcher\HttpDispatcher->dispatch() called at [/mnt/c/code/php/gold-pet/vendor/hyperf/http-server/src/Server.php:118]
PHP Fatal error: Uncaught Swoole\Error: The cURL client is executing, this handle cannot be operated in /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php:492
Stack trace:
#0 /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php(492): curl_getinfo()
#1 [internal function]: OSS\Http\RequestCore->streaming_header_callback()
#2 /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php(844): curl_exec()
#3 /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php(2960): OSS\Http\RequestCore->send_request()
#4 /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php(2050): OSS\OssClient->auth()
#5 /mnt/c/code/php/gold-pet/vendor/xxtime/flysystem-aliyun-oss/src/OssAdapter.php(251): OSS\OssClient->doesObjectExist()
#6 /mnt/c/code/php/gold-pet/vendor/league/flysystem/src/Filesystem.php(57): Xxtime\Flysystem\Aliyun\OssAdapter->has()
#7 /mnt/c/code/php/gold-pet/vendor/league/flysystem/src/Filesystem.php(98): League\Flys in /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php on line 492
Fatal error: Uncaught Swoole\Error: The cURL client is executing, this handle cannot be operated in /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php:492
Stack trace:
#0 /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php(492): curl_getinfo()
#1 [internal function]: OSS\Http\RequestCore->streaming_header_callback()
#2 /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php(844): curl_exec()
#3 /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php(2960): OSS\Http\RequestCore->send_request()
#4 /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php(2050): OSS\OssClient->auth()
#5 /mnt/c/code/php/gold-pet/vendor/xxtime/flysystem-aliyun-oss/src/OssAdapter.php(251): OSS\OssClient->doesObjectExist()
#6 /mnt/c/code/php/gold-pet/vendor/league/flysystem/src/Filesystem.php(57): Xxtime\Flysystem\Aliyun\OssAdapter->has()
#7 /mnt/c/code/php/gold-pet/vendor/league/flysystem/src/Filesystem.php(98): League\Flys in /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php on line 492
[2020-12-09 16:52:51 *22204.14] ERROR php_swoole_server_rshutdown (ERRNO 503): Fatal error: Uncaught Swoole\Error: The cURL client is executing, this handle cannot be operated in /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php:492
Stack trace:
#0 /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php(492): curl_getinfo()
#1 [internal function]: OSS\Http\RequestCore->streaming_header_callback()
#2 /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php(844): curl_exec()
#3 /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php(2960): OSS\Http\RequestCore->send_request()
#4 /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/OssClient.php(2050): OSS\OssClient->auth()
#5 /mnt/c/code/php/gold-pet/vendor/xxtime/flysystem-aliyun-oss/src/OssAdapter.php(251): OSS\OssClient->doesObjectExist()
#6 /mnt/c/code/php/gold-pet/vendor/league/flysystem/src/Filesystem.php(57): Xxtime\Flysystem\Aliyun\OssAdapter->has()
#7 /mnt/c/code/php/gold-pet/vendor/league/flysystem/src/Filesystem.php(98): League\Flys in /mnt/c/code/php/gold-pet/vendor/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php on line 492
[2020-12-09 16:52:51 $21901.0] WARNING check_worker_exit_status: worker#14[pid=22204] abnormal exit, status=255, signal=0
- What version of Swoole are you using (show your
php --ri swoole)?
swoole
Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.6.0-alpha
Built => Dec 9 2020 16:42:08
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 1.1.1 11 Sep 2018
http2 => enabled
json => enabled
curl-native => enabled
pcre => enabled
zlib => 1.2.11
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => 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 => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608
- What is your machine environment used (show your
uname -a&php -v&gcc -v) ?
uname -a
Linux WIM-20201022RHR 4.4.0-17763-Microsoft #253-Microsoft Mon Dec 31 17:49:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
php -v
PHP 7.4.13 (cli) (built: Dec 8 2020 15:40:23) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --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-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --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 --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 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (8 by maintainers)
@cexll 已修复,在 curl_exec 的回调函数中会使用 curl_getinfo,底层没有允许这个行为。