swoole-src icon indicating copy to clipboard operation
swoole-src copied to clipboard

When I execute curl function in facebook sdk, swoole crash.

Open natici opened this issue 3 years ago • 1 comments

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a simple script for reproducing the error. 微信截图_20210809202431

  2. What did you expect to see? The script executes normally instead of waiting all the time.

  3. What did you see instead? The script has been executing, just like an endless loop with these report:

Process 2162243 (php) of user 989 dumped core.
                                               
                                               Stack trace of thread 2162716:
                                               #0  0x00007fa39204c6c3 _ZNKSt8functionIFvvEEclEv (swoole.so)
                                               #1  0x00007fa3920603aa operator() (swoole.so)
                                               #2  0x00007fa391c54ba3 execute_native_thread_routine (libstdc++.so.6)
                                               #3  0x00007fa394b0814a start_thread (libpthread.so.0)
                                               #4  0x00007fa394e1cdc3 __clone (libc.so.6)
                                               
                                               Stack trace of thread 2162715:
                                               #0  0x00007fa394b0e2fc pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                                               #1  0x00007fa391c4e8f0 _ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE (libstdc++.so.6)
                                               #2  0x00007fa39206067e operator() (swoole.so)
                                               #3  0x00007fa391c54ba3 execute_native_thread_routine (libstdc++.so.6)
                                               #4  0x00007fa394b0814a start_thread (libpthread.so.0)
                                               #5  0x00007fa394e1cdc3 __clone (libc.so.6)
                                               
                                               Stack trace of thread 2162243:
                                               #0  0x00007fa394e0d67f write (libc.so.6)
                                               #1  0x00007fa396ee9129 sock_write (libcrypto.so.1.1)
                                               #2  0x00007fa396ee281e bwrite_conv (libcrypto.so.1.1)
                                               #3  0x00007fa396ee1843 bio_write_intern (libcrypto.so.1.1)
                                               #4  0x00007fa396ee1ce7 BIO_write (libcrypto.so.1.1)
                                               #5  0x00007fa39734264f ssl3_write_pending (libssl.so.1.1)
                                               #6  0x00007fa3973435a1 do_ssl3_write.localalias.3 (libssl.so.1.1)
                                               #7  0x00007fa397343836 ssl3_write_bytes (libssl.so.1.1)
                                               #8  0x00007fa397356ae6 ssl_write_internal (libssl.so.1.1)
                                               #9  0x00007fa397356c17 SSL_write (libssl.so.1.1)
                                               #10 0x00007fa3966e6bb7 ossl_send (libcurl.so.4)
                                               #11 0x00007fa396699c88 Curl_write (libcurl.so.4)
                                               #12 0x00007fa3966ad6d7 Curl_readwrite (libcurl.so.4)
                                               #13 0x00007fa3966b7224 multi_runsingle (libcurl.so.4)
                                               #14 0x00007fa3966b85e2 multi_socket (libcurl.so.4)
                                               #15 0x00007fa3966b88c9 curl_multi_socket_action (libcurl.so.4)
                                               #16 0x00007fa391fc0a27 _ZN6swoole4curl5Multi4execEP8php_curl (swoole.so)
                                               #17 0x00007fa3920a1c0d zif_swoole_native_curl_exec (swoole.so)
                                               #18 0x000000000082d620 ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER (php)
                                               #19 0x00007fa391fba13d _ZN6swoole12PHPCoroutine9main_funcEPv (swoole.so)
                                               #20 0x00007fa39203bf90 _ZNKSt8functionIFvPvEEclES0_ (swoole.so)
                                               #21 0x00007fa3920b5541 make_fcontext (swoole.so)
  1. What version of Swoole are you using (show your php --ri swoole)?
swoole

Swoole => enabled
Author => Swoole Team <[email protected]>
Version => 4.7.0
Built => Aug  9 2021 19:46:50
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
openssl => OpenSSL 1.1.1g FIPS  21 Apr 2020
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
zlib => 1.2.11
mutex_timedlock => enabled
pthread_barrier => enabled
futex => 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
  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
Linux MDP 4.18.0-240.22.1.el8_3.x86_64 #1 SMP Thu Apr 8 19:01:30 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

PHP 7.4.19 (cli) (built: May 29 2021 17:17:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.4.1 20200928 (Red Hat 8.4.1-1) (GCC) 

natici avatar Aug 09 '21 12:08 natici

Please use valgrind to track memory errors.

USE_ZEND_ALLOC=0 valgrind php your_file.php

matyhtf avatar Aug 10 '21 11:08 matyhtf