FPM: Freeing child allocated data
まだ誰も着手していません。
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.1k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
FPM allocates some data during child initialization for keeping around some configuration options. This is done in following places:
- https://github.com/php/php-src/blob/15184435007ae13d31902be2613632b813b80b0f/sapi/fpm/fpm/fpm_log.c#L81 (this was reported in https://bugs.php.net/bug.php?id=75635 and it is the reason for creating this issue).
- https://github.com/php/php-src/blob/15184435007ae13d31902be2613632b813b80b0f/sapi/fpm/fpm/fpm_log.c#L91
- https://github.com/php/php-src/blob/15184435007ae13d31902be2613632b813b80b0f/sapi/fpm/fpm/fpm_status.c#L32
- https://github.com/php/php-src/blob/15184435007ae13d31902be2613632b813b80b0f/sapi/fpm/fpm/fpm_status.c#L40-L41
- https://github.com/php/php-src/blob/15184435007ae13d31902be2613632b813b80b0f/sapi/fpm/fpm/fpm_php.c#L219-L221 (this just takes ownership but means the same sort of leak effectively)
Those values are never freed. They are needed for the whole life of child so it is not a big issue as it gets released on process exit (that's why this is classified more as a feature and not a bug because there is no impact of this). However it is a good convention to free those values so some child destroy functions should be created for that purpose and called before exiting the child.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず sapi/fpm/fpm/fpm_log.c、fpm_status.c、fpm_php.c の子プロセス初期化コードを読み、続いて子プロセスの終了経路を追跡します。issue に記載されているアロケーションに対応する子プロセス破棄処理を追加し、子プロセスが終了する前に呼び出します。これらの子プロセス所有の値がプロセス終了時だけでなく、シャットダウン中に解放されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, php
- 領域
- backend
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100