docker-library / php

Docker Official Image packaging for PHP
https://php.net
MIT License
3.84k stars 2k forks source link

Bundled curl version is causing segfault #1508

Closed ro0NL closed 6 months ago

ro0NL commented 7 months ago

Hi,

We noticed segfaults in prod, tracked down to mostllike the current bundled curl version for php 8.1.28 (being 7.88.1).

We couldnt reproduce with php 8.1.0 with bundles curl version 7.74.0

Here's the reproducer: https://github.com/ro0NL/php-bug

$ while true; do docker build . --no-cache || break; done

 => ERROR [4/4] RUN php test.php                                                                                                                                                                                        1.3s
------                                                                                                                                                                                                                       
 > [4/4] RUN php test.php:
1.235 Segmentation fault (core dumped)
------
Dockerfile:6
--------------------
   4 |     
   5 |     COPY . .
   6 | >>> RUN php test.php
   7 |     
--------------------

Relevant stack trace:

#0  0x0000793b372bb937 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x0000793b3742675c in ?? () from /lib/x86_64-linux-gnu/libcurl.so.4
#2  0x0000793b36eeb2ca in nghttp2_session_mem_recv () from /lib/x86_64-linux-gnu/libnghttp2.so.14
#3  0x0000793b37425207 in ?? () from /lib/x86_64-linux-gnu/libcurl.so.4
#4  0x0000793b37425df7 in ?? () from /lib/x86_64-linux-gnu/libcurl.so.4
#5  0x0000793b37442dd9 in ?? () from /lib/x86_64-linux-gnu/libcurl.so.4
#6  0x0000793b37455aa9 in ?? () from /lib/x86_64-linux-gnu/libcurl.so.4
#7  0x0000793b37438fd4 in ?? () from /lib/x86_64-linux-gnu/libcurl.so.4
#8  0x0000793b3743a3b6 in curl_multi_perform () from /lib/x86_64-linux-gnu/libcurl.so.4
#9  0x000064aa4d11ca18 in ?? ()
#10 0x000064aa4d039d98 in ?? ()
#11 0x000064aa4d03aeef in ?? ()
#12 0x000064aa4d3b60e2 in zend_generator_resume ()
#13 0x000064aa4d3b6c89 in ?? ()
#14 0x000064aa4d351f46 in ?? ()
#15 0x000064aa4d364a73 in ?? ()
#16 0x000064aa4d3984cd in execute_ex ()
#17 0x000064aa4d3a09ef in zend_execute ()
#18 0x000064aa4d3331e8 in zend_execute_scripts ()

Also filed under https://github.com/php/php-src/issues/14102

ro0NL commented 6 months ago

I've swapped to non-cURL client for this specific case.

Will bump to php 8.3 asap.