Fix segmentation fault of swoole on PHP 8.3 (#847)

pull/849/head 2.1.69
Michele Locati 2023-12-13 20:14:33 +01:00 committed by GitHub
parent fd79b42db7
commit 8595a480f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 4 deletions

View File

@ -3598,6 +3598,12 @@ installRemoteModule() {
fi fi
;; ;;
esac esac
if test $PHP_MAJMIN_VERSION -eq 803; then
# see https://github.com/swoole/docker-swoole/issues/45
installRemoteModule_curl=no
else
installRemoteModule_curl=yes
fi
if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 5.0.1) -ge 0; then
# enable sockets supports? # enable sockets supports?
addConfigureOption enable-sockets $installRemoteModule_sockets addConfigureOption enable-sockets $installRemoteModule_sockets
@ -3606,7 +3612,7 @@ installRemoteModule() {
# enable mysqlnd support? # enable mysqlnd support?
addConfigureOption enable-mysqlnd yes addConfigureOption enable-mysqlnd yes
# enable curl support? # enable curl support?
addConfigureOption enable-swoole-curl yes addConfigureOption enable-swoole-curl $installRemoteModule_curl
# enable cares support? # enable cares support?
addConfigureOption enable-cares yes addConfigureOption enable-cares yes
# enable brotli support? # enable brotli support?
@ -3619,7 +3625,7 @@ installRemoteModule() {
# enable mysqlnd support? # enable mysqlnd support?
addConfigureOption enable-mysqlnd yes addConfigureOption enable-mysqlnd yes
# enable curl support? # enable curl support?
addConfigureOption enable-swoole-curl yes addConfigureOption enable-swoole-curl $installRemoteModule_curl
# enable cares support? # enable cares support?
addConfigureOption enable-cares yes addConfigureOption enable-cares yes
elif test $(compareVersions "$installRemoteModule_version" 4.8.11) -ge 0; then elif test $(compareVersions "$installRemoteModule_version" 4.8.11) -ge 0; then
@ -3634,7 +3640,7 @@ installRemoteModule() {
# enable json support? # enable json support?
addConfigureOption enable-swoole-json yes addConfigureOption enable-swoole-json yes
# enable curl support? # enable curl support?
addConfigureOption enable-swoole-curl yes addConfigureOption enable-swoole-curl $installRemoteModule_curl
# enable cares support? # enable cares support?
addConfigureOption enable-cares yes addConfigureOption enable-cares yes
elif test $(compareVersions "$installRemoteModule_version" 4.6.1) -ge 0; then elif test $(compareVersions "$installRemoteModule_version" 4.6.1) -ge 0; then
@ -3649,7 +3655,7 @@ installRemoteModule() {
# enable json support? # enable json support?
addConfigureOption enable-swoole-json yes addConfigureOption enable-swoole-json yes
# enable curl support? # enable curl support?
addConfigureOption enable-swoole-curl yes addConfigureOption enable-swoole-curl $installRemoteModule_curl
elif test $(compareVersions "$installRemoteModule_version" 4.4.0) -ge 0; then elif test $(compareVersions "$installRemoteModule_version" 4.4.0) -ge 0; then
# enable sockets supports? # enable sockets supports?
addConfigureOption enable-sockets $installRemoteModule_sockets addConfigureOption enable-sockets $installRemoteModule_sockets

15
scripts/tests/swoole Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env php
<?php
if (extension_loaded('curl')) {
// This leads to Segmentation fault when the script ends
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1/foo');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if (defined('CURLOPT_TIMEOUT_MS')) {
curl_setopt($ch, CURLOPT_TIMEOUT_MS, 1);
} else {
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
}
curl_exec($ch);
}