Skip to content
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

Problem with PHP's tracing JIT + cURL Multi + OpenSwoole #312

Open
onethumb opened this issue Apr 26, 2023 · 0 comments
Open

Problem with PHP's tracing JIT + cURL Multi + OpenSwoole #312

onethumb opened this issue Apr 26, 2023 · 0 comments

Comments

@onethumb
Copy link

onethumb commented Apr 26, 2023

  1. What did you do? If possible, provide a simple script for reproducing the error.

When using PHP's tracing JIT (with opcache.jit=tracing or opcache.jit=1255) with OpenSwoole and cURL Multi, it fails, either by returning a Invalid multi handle error from cURL or by dumping core.

Using either opcache.jit=1235 (T=3, Profile on the fly and compile hot functions) or opcache.jit=1251 (O=1, Minimal JIT (call standard VM handlers)) both work fine (as does anything less performant than either of these settings).

See reproduce script here.

  1. What did you expect to see?
Getting Parallel Url=https://www.smugmug.com/
Getting Parallel Url=https://www.flickr.com/
    Done with curl_multi_exec Uri=https://www.flickr.com/ ResponseCode=200
    Done with curl_multi_exec Uri=https://www.smugmug.com/ ResponseCode=200
Getting serial URL=https://www.smugmug.com/
    Done with curl_multi_exec Uri=https://www.smugmug.com/ ResponseCode=200
Getting serial URL=https://www.flickr.com/
    Done with curl_multi_exec Uri=https://www.flickr.com/ ResponseCode=200
Getting Parallel Url=https://www.smugmug.com/
Getting Parallel Url=https://www.flickr.com/
    Done with curl_multi_exec Uri=https://www.flickr.com/ ResponseCode=200
    Done with curl_multi_exec Uri=https://www.smugmug.com/ ResponseCode=200
Done!
  1. What did you see instead?
Getting Parallel Url=https://www.smugmug.com/
Getting Parallel Url=https://www.flickr.com/
    Done with curl_multi_exec Uri=https://www.smugmug.com/ ResponseCode=200
    Done with curl_multi_exec Uri=https://www.flickr.com/ ResponseCode=200
Getting serial URL=https://www.smugmug.com/
    Done with curl_multi_exec Uri=https://www.smugmug.com/ ResponseCode=200
Getting serial URL=https://www.flickr.com/
    Done with curl_multi_exec Uri=https://www.flickr.com/ ResponseCode=200
Getting Parallel Url=https://www.smugmug.com/
    ERROR! Invalid multi handle

or

Getting Parallel Url=https://www.smugmug.com/
Getting Parallel Url=https://www.flickr.com/
    Done with curl_multi_exec Uri=https://www.smugmug.com/ ResponseCode=200
    Done with curl_multi_exec Uri=https://www.flickr.com/ ResponseCode=200
Getting serial URL=https://www.smugmug.com/
Segmentation fault (core dumped)
  1. What version of OpenSwoole are you using (show your php --ri openswoole)?
openswoole

Open Swoole => enabled
Author => Open Swoole Group <[email protected]>
Version => 22.0.0
Built => Apr 21 2023 20:00:16
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.1  11 Sep 2018
dtls => enabled
http2 => enabled
hook-curl => enabled
pcre => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled

Directive => Local Value => Master Value
openswoole.enable_coroutine => On => On
openswoole.enable_preemptive_scheduler => Off => Off
openswoole.display_errors => On => On
openswoole.unixsock_buffer_size => 8388608 => 8388608
  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

This issue happens on both Ubuntu Bionic 18.04 and Ubuntu Jammy 22.04.

uname -a (Ubuntu Bionic):

Linux 914d33c414d6 5.15.0-1014-aws #18-Ubuntu SMP Wed Jun 15 20:06:08 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

uname -a (Ubuntu Jammy):

Linux 0921e394afb6 5.15.0-1014-aws #18-Ubuntu SMP Wed Jun 15 20:06:08 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

php -v (same on both):

PHP 8.1.9 (cli) (built: Aug 13 2022 01:10:42) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.9, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.9, Copyright (c), by Zend Technologies

gcc -v (Ubuntu Bionic):

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/7/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=aarch64-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-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)

gcc -v (Ubuntu Jammy):

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/11/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.3.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=aarch64-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-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)

php --ri curl (Ubuntu Bionic):

curl

cURL support => enabled
cURL Information => 7.58.0
Age => 4
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 => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smb, smbs, smtp, smtps, telnet, tftp
Host => aarch64-unknown-linux-gnu
SSL Version => OpenSSL/1.1.1
ZLib Version => 1.2.11

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

php --ri curl (Ubuntu Jammy):

curl

cURL support => enabled
cURL Information => 7.81.0
Age => 9
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
Protocols => dict, file, ftp, ftps, gopher, gophers, http, https, imap, imaps, ldap, ldaps, mqtt, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Host => aarch64-unknown-linux-gnu
SSL Version => OpenSSL/3.0.2
ZLib Version => 1.2.11
libSSH Version => libssh/0.9.6/openssl/zlib

Directive => Local Value => Master Value
curl.cainfo => 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

1 participant