php / php/php-src

php-fpm freezes in uninterruptible accept() system call on Ubuntu 24.04

未关闭
#20,290 1 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

@bukka 已经在做这个了。

开始于 2025年10月25日。

Bug SAPI: fpm Status: Needs Triage
主要语言
C
星标
40.4k
派生
8.1k
平均合并
2 天 13 小时
30 天内合并 PR
96

描述

Description

On a fresh installation of Ubuntu 24.04, the php-fpm service enters an uninterruptible sleep state after completing a web request, causing all subsequent requests to time out. This bug is 100% reproducible and appears to be a deep, low-level incompatibility.
This bug has been reproduced with two separate PHP builds:
The official php8.3-fpm package from the main Ubuntu 24.04 repository.
The php8.4-fpm package from the ppa:ondrej/php PPA.
In both cases, the service exhibits the exact same freezing behavior.
Environment:
OS: Ubuntu 24.04 (Fresh installation, kernel Linux server 6.8.0-31-generic)
Hardware: Dell Optiplex 990 (Intel Core i5-2400)
Web Server: Nginx 1.24.0
PHP Version: Tested and failed on both 8.3 (official Ubuntu) and 8.4 (ppa:ondrej/php).
Steps to Reproduce:
Set up a standard Nginx + PHP-FPM environment on Ubuntu 24.04.
Run the php-fpm service via systemd.
Send any simple PHP web request (e.g., phpinfo();).
The first request will likely succeed. Subsequent requests will hang, and strace reveals the worker process is frozen.
Definitive strace Proof:
We have captured the exact moment of failure by running php-fpm under strace -f. The worker process successfully completes one request and then freezes permanently on the subsequent accept() system call. It enters an uninterruptible state that requires kill -9 to terminate.
Here are the final lines of the trace for the frozen PID:
[pid 898632] shutdown(5, SHUT_WR) = 0
[pid 898632] recvfrom(5, "\1\5\0\1\0\0\0\0", 8, 0, NULL, NULL) = 8
[pid 898632] recvfrom(5, "", 8, 0, NULL, NULL) = 0
[pid 898632] close(5) = 0
[pid 898632] write(2, "\0fscf\0", 6) = 6
[pid 898632] accept(10, <unfinished ...>
What We Have Ruled Out:
This is not a user-space configuration issue. We have proven that:
The www-data user has full network access from the command line (sudo -u www-data curl ... succeeds).
A full PHP script with cURL POST requests succeeds when run from the command line as www-data.
There are no restrictive systemd, AppArmor, or ufw policies being applied.
The issue is specific to the php-fpm service environment itself and its interaction with the kernel accept() system call. This is a critical, showstopper bug for using PHP-FPM on this platform.

PHP Version
PHP 8.4.13 (cli) (built: Oct  1 2025 20:34:15) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.4.13, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.13, Copyright (c), by Zend Technologies
Operating System

Ubuntu 24.04.3 LTS x86_64

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。