String corruption on deployments with php-fpm 8.1.6
まだ誰も着手していません。
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.1k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
Hello,
We experience seemingly random in-memory corruption of code when deploying new versions of our PHP app on php-fpm 8.1.6 on Linux. Here is a sample error message:
include(/space/www/api2019/data/releases/20220607140425/vendor/la�R�F): Failed to open stream: No such file or directory
This example happens in the class loader from composer. The beginning of the file name is correct, the end is obviously not.
Another example (another release on another server):
Call to undefined function Symfony\Component\HttpFoundation\implode()
This bug is not easily reproducible, it happens in random-looking places in the code, sometimes but not always, on some servers but not others (we have 10 app servers, the bug appears on one server at a time, very rarely two, not on every release but more than half of them).
When it happens, it looks like there is only one corrupted chunk of data; depending on the affected data, it may only cause a few real errors or basically prevent the code from working on the server at all. It generates errors for a few minutes. Restarting the fpm daemon fixes it; reloading it or running opcache_reset() does not.
We will try to reproduce it on a staging server; at the moment I can only say it appears under load and not under light testing.
It may or may not be related to #8731 (same app, same servers, seemingly fixed by downgrading to 8.0.19).
I know this report is not really helpful, but I'm at a loss how to make it more useful.
Downgrading to PHP 8.0.19 seems to fix the issue.
PHP Version
PHP 8.1.6 (cli) (built: May 17 2022 16:49:19) (NTS)
Operating System
Debian 10
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、Debian 10 上で PHP-FPM 8.1.6 を実行している負荷のかかったステージングサーバーで破損の再現を試み、PHP 8.0.19 の場合と比較します。FPM の再起動、リロード、または opcache_reset() の実行によって結果が変わるかを観察し、Composer ClassLoader の失敗と #8731 との関連の可能性を確認します。再現可能な原因を特定し、検証済みの修正を確認できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100