#66352·symfony

[HttpClient] PHP-FPM SIGSEGV while reading an HTTP/2 response with maxPendingPushes=50

Author: ChristopherWalzCreated Sep 26, 2026Updated Sep 26, 2026
LabelsBugStatus: Needs ReviewHttpClient

Symfony version(s) affected

8.1.7

Description

Fetching this public Notion page through Symfony's CurlHttpClient can terminate a PHP-FPM worker with SIGSEGV:

https://zentio.notion.site/Careers-at-Zentio-2b83d733287181edb53bcd2dd82258ec

The request receives HTTP status 200 and response headers. The worker then exits while $response->getContent(false) reads the body, and nginx returns 502 Bad Gateway. No PHP exception is raised. Our encoding and HTML processing run after getContent() and are not required to trigger the crash.

An A/B test with fresh CurlHttpClient instances isolated the maxPendingPushes setting in our environment. Both variants used the original transport defaults, maxHostConnections=6, the same logger and URL, and Accept-Encoding: identity:

maxPendingPushes Result
0 HTTP/2 response body received successfully: 20,034 bytes
50 PHP-FPM worker exited after logging the response headers; reproduced twice

The failing responses were not gzip encoded. The logged http_version: 3 is libcurl's numeric value for HTTP/2, not HTTP/3. The response contained one Link header, but we have not confirmed that the server sent an HTTP/2 PUSH_PROMISE frame.

Additional controls: raw PHP cURL, a bare Symfony CurlHttpClient, and a minimal NoPrivateNetworkHttpClient wrapper all received the page over HTTP/2. Using the original inner Symfony transport or a fresh transport configured with maxPendingPushes=50 crashed. Forcing HTTP/1.1 avoided the crash, but our crawler visits many unrelated URLs and should retain HTTP/2 support.

Environment: PHP 8.5.11 under PHP-FPM in Docker; libcurl 8.22.0; OpenSSL 3.5.8; symfony/http-client v8.1.7. No application proxy was configured (HTTP_PROXY was empty). A native backtrace is not available yet, so we cannot assign the underlying fault to Symfony, PHP's cURL extension, libcurl, or another native dependency.

Possibly related older issue: https://github.com/symfony/symfony/issues/57681

How to reproduce

The A/B results below were recorded inside our Symfony application. This controller is a reduced example derived from those tests; it has not yet been executed independently in a clean Symfony project. It copies the injected cURL transport's stored defaults so that the two requests differ in maxPendingPushes. Reflection is used only for this diagnostic reproduction.

Add the following controller to a Symfony application using the affected PHP-FPM and HttpClient versions:

php
<?php

namespace App\Controller;

use Psr\Log\LoggerInterface;
use Symfony\Component\HttpClient\CurlHttpClient;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Contracts\HttpClient\HttpClientInterface;

final class Http2PushReproController
{
    #[Route('/_debug/http2-push/{limit}', requirements: ['limit' => '0|50'])]
    public function __invoke(
        int $limit,
        HttpClientInterface $httpClient,
        LoggerInterface $logger,
    ): JsonResponse {
        $url = 'https://zentio.notion.site/Careers-at-Zentio-2b83d733287181edb53bcd2dd82258ec';

        $original = $httpClient;

        for ($i = 0; $i < 10 && !$original instanceof CurlHttpClient; ++$i) {
            $reflection = new \ReflectionObject($original);

            if (!$reflection->hasProperty('client')) {
                throw new \LogicException(
                    'No inner client on '.get_debug_type($original)
                );
            }

            $original = $reflection->getProperty('client')->getValue($original);

            if (!$original instanceof HttpClientInterface) {
                throw new \LogicException('Unexpected inner client');
            }
        }

        if (!$original instanceof CurlHttpClient) {
            throw new \LogicException('No CurlHttpClient in injected client chain');
        }

        $originalDefaults = (new \ReflectionObject($original))
            ->getProperty('defaultOptions')
            ->getValue($original);

        $constructorDefaults = array_intersect_key(
            $originalDefaults,
            CurlHttpClient::OPTIONS_DEFAULTS,
        );

        if (isset($originalDefaults['auth_ntlm'])) {
            $constructorDefaults['auth_ntlm'] = $originalDefaults['auth_ntlm'];
        }

        $client = new CurlHttpClient($constructorDefaults, 6, $limit);
        $client->setLogger($logger);

        $client = $client->withOptions([
            'headers' => [
                'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0',
                'Accept-Language' => 'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7',
                'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
                'Accept-Encoding' => 'identity',
            ],
            // Existing application settings, copied to match the A/B test.
            'verify_peer' => false,
            'verify_host' => false,
            'max_redirects' => 10,
            'extra' => ['use_persistent_connections' => false],
        ]);

        $logger->notice('HTTP/2 push test started', [
            'limit' => $limit,
            'pid' => getmypid(),
            'url' => $url,
        ]);

        $response = $client->request('GET', $url);
        $status = $response->getStatusCode();
        $headers = $response->getHeaders(false);

        $logger->notice('HTTP/2 push test headers received', [
            'limit' => $limit,
            'pid' => getmypid(),
            'status' => $status,
            'http_version' => $response->getInfo('http_version'),
            'content_encoding' => $headers['content-encoding'][0] ?? null,
            'link_header_count' => count($headers['link'] ?? []),
        ]);

        // The worker exited during this call in the application's A/B test.
        $body = $response->getContent(false);

        $logger->notice('HTTP/2 push test body received', [
            'limit' => $limit,
            'pid' => getmypid(),
            'bytes' => strlen($body),
        ]);

        return new JsonResponse([
            'status' => $status,
            'http_version' => $response->getInfo('http_version'),
            'bytes' => strlen($body),
        ]);
    }
}

Call these URLs as separate PHP-FPM requests:

  1. /_debug/http2-push/0
  2. /_debug/http2-push/50 — repeat if necessary.

Expected: Both requests return JSON containing status 200 and a nonzero body size.

Observed in the actual application A/B test: With maxPendingPushes=0, the body was received over HTTP/2. With maxPendingPushes=50, two requests logged status 200 and HTTP/2 headers, then ended with a gateway error without logging a received body. No HTTP version override was set.

Selected application logs (application-specific logger prefix omitted):

[2026-09-26T05:30:28.222753+00:00] HTTP/2 push test started {"variant":"push_off","pid":371,"test":"identity","max_host_connections":6,"max_pending_pushes":0,"url":"https://zentio.notion.site/Careers-at-Zentio-2b83d733287181edb53bcd2dd82258ec"}
[2026-09-26T05:30:28.400937+00:00] HTTP/2 push test headers received {"variant":"push_off","pid":371,"status":200,"http_version":3,"content_encoding":null,"link_header_count":1,"url":"https://zentio.notion.site/Careers-at-Zentio-2b83d733287181edb53bcd2dd82258ec"}
[2026-09-26T05:30:29.013305+00:00] HTTP/2 push test body received {"variant":"push_off","pid":371,"bytes":20034,"http_version":3}
[2026-09-26T05:30:29.016246+00:00] HTTP/2 push test finished {"variant":"push_off","pid":371,"status":200,"bytes":20034}

[2026-09-26T05:30:55.349406+00:00] HTTP/2 push test started {"variant":"push_on","pid":372,"test":"identity","max_host_connections":6,"max_pending_pushes":50,"url":"https://zentio.notion.site/Careers-at-Zentio-2b83d733287181edb53bcd2dd82258ec"}
[2026-09-26T05:30:55.508710+00:00] HTTP/2 push test headers received {"variant":"push_on","pid":372,"status":200,"http_version":3,"content_encoding":null,"link_header_count":1,"url":"https://zentio.notion.site/Careers-at-Zentio-2b83d733287181edb53bcd2dd82258ec"}

[2026-09-26T05:30:58.283139+00:00] HTTP/2 push test started {"variant":"push_on","pid":378,"test":"identity","max_host_connections":6,"max_pending_pushes":50,"url":"https://zentio.notion.site/Careers-at-Zentio-2b83d733287181edb53bcd2dd82258ec"}
[2026-09-26T05:30:58.437858+00:00] HTTP/2 push test headers received {"variant":"push_on","pid":378,"status":200,"http_version":3,"content_encoding":null,"link_header_count":1,"url":"https://zentio.notion.site/Careers-at-Zentio-2b83d733287181edb53bcd2dd82258ec"}

This PHP-FPM log confirms a SIGSEGV during an earlier baseline run; it is not a log from the 05:30 A/B requests:

symfony | [26-Sep-2026 04:34:11] WARNING: [pool www] child 300 exited on signal 11 (SIGSEGV - core dumped) after 296.574790 seconds from start
symfony | [26-Sep-2026 04:34:11] NOTICE: [pool www] child 311 started

Possible Solution

Please investigate the HTTP/2 push callback/response lifecycle when maxPendingPushes > 0 is used through PHP's cURL extension. A native backtrace is still needed to assign the fault to Symfony, PHP/ext-curl, libcurl, or another native component.

For our application, constructing the same HTTP/2 client with maxPendingPushes=0 avoided the observed crash. Exposing a supported FrameworkBundle option to disable pending pushes would provide a targeted mitigation without forcing HTTP/1.1 for every request. Setting the third argument of the http_client.transport definition to 0 in a compiler pass is a potential application workaround, but this container-wide workaround has not yet been independently verified in our deployment:

$container->getDefinition('http_client.transport')->setArgument(2, 0);

Additional Context

No response