php_embed_ub_write does not return on error
まだ誰も着手していません。
評価
調査の方向性
sapi/embed/php_embed.c の php_embed_ub_write から開始し、php_embed_single_write のエラーパス、続いて php_handle_aborted_connection を追跡します。接続が中断されていない場合に、ゼロバイトの書き込みが無限に繰り返されないことを確認します。完了条件は、関数が無限ループする代わりに、エラー後に書き込まれたバイト数を返すことです。
索引モデルが issue の本文から書いたものです。
説明
Description
sapi/embed/php_embed.c:
/* SAPIs only have unbuffered write operations. This is because PHP's output
* buffering feature will handle any buffering of the output and invoke the
* SAPI unbuffered write operation when it flushes the buffer.
*/
static size_t php_embed_ub_write(const char *str, size_t str_length)
{
const char *ptr = str;
size_t remaining = str_length;
size_t ret;
while (remaining > 0) {
ret = php_embed_single_write(ptr, remaining);
if (!ret) {
php_handle_aborted_connection();
}
ptr += ret;
remaining -= ret;
}
return str_length;
}
php_handle_aborted_connection does not always abort, i.e. if ignore_user_abort=1. So I sending fails and ret is 0, then remaining is never decremented and this loops forever.
It should probably return str_length - remaining after php_handle_aborted_connection().
PHP Version
master
Operating System
No response
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 14時間
- マージ済み PR(30日)
- 112
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
php/php-src のほかの issue
-
Bug SAPI: cli_server Status: Verified
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
Bug Status: Needs Triage
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
Bug Category: Tests Status: Verified
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Bug SAPI: fpm Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
level/task module/gcp type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
hapostgres/pg_auto_failover#1190 ·
-
docs
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
P3 sonic-vpp
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
sonic-net/sonic-buildimage#29662 ·