|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76416 cURL request to SSL resource crashes with segmentation fault
Submitted: 2018-06-05 14:47 UTC Modified: 2018-08-19 17:59 UTC
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: vojta at webow dot ski Assigned: bukka (profile)
Status: Not a bug Package: cURL related
PHP Version: 7.2.6 OS: Alpine 3.7.0
Private report: No CVE-ID: None
 [2018-06-05 14:47 UTC] vojta at webow dot ski
Custom PHP-FPM in docker, it works just fine with libressl

OpenSSL 1.0.2o
curl 7.60.0

'./configure'  '--enable-fpm' '--with-fpm-user=www-data' '--with-fpm-group=www-data' '--enable-cli' '--build=x86_64-linux-musl' '--with-config-file-path=/usr/local/etc/php' '--with-config-file-scan-dir=/usr/local/etc/php/conf.d' '--with-php-config' '--with-mysqli' '--with-pdo-mysql' '--with-openssl' '--with-gd' '--with-iconv' '--with-zlib' '--with-curl' '--with-png-dir' '--with-jpeg-dir' '--with-freetype-dir' '--with-xmlrpc' '--with-mhash' '--enable-xml' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--enable-mbregex' '--enable-gd-native-ttf' '--enable-pcntl' '--enable-sockets' '--enable-zip' '--enable-soap' '--enable-session' '--enable-opcache' '--enable-bcmath' '--enable-exif' '--enable-fileinfo' '--enable-ftp' '--with-libedit' '--disable-cgi' '--disable-rpath' '--enable-mbstring' '--enable-mysqlnd' '--with-pcre-regex=/usr' 'build_alias=x86_64-linux-musl'

Test script:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '');


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-05 22:15 UTC]
-Status: Open +Status: Feedback
 [2018-06-05 22:15 UTC]
Works fine for me here with 7.2.6. What does the backtrace look like in that segfault?
 [2018-06-06 08:37 UTC] vojta at webow dot ski
-Status: Feedback +Status: Open
 [2018-06-06 08:37 UTC] vojta at webow dot ski
GDB output:
Starting program: /usr/local/bin/php test.php
[New LWP 37]
[LWP 37 exited]

Thread 1 "php" received signal SIGSEGV, Segmentation fault.
0x00007ffff59f538f in ?? () from /lib/

I would be more than happy to provide more output, if you point me to the right direction.

 [2018-08-19 17:58 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: bukka
 [2018-08-19 17:58 UTC]
You need to make sure that curl is linked with the correct OpenSSL version and ideally it should be the same one that you use with openssl ext. You can't mix LibreSSL and OpenSSL of course.

In any case this is not an issue in openssl ext because curl is linked with OpenSSL lib and it's using its own API.
 [2018-08-19 17:59 UTC]
-Package: OpenSSL related +Package: cURL related
 [2018-08-19 17:59 UTC]
-Status: Closed +Status: Not a bug
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Aug 04 07:01:24 2021 UTC