opcache.file_cache: segfault or wrong function for functions loaded with dl()
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- backend, performance
調査の方向性
Start with the ZEND_INIT_FCALL offset handling in zend_file_cache.c and review the change identified as d6541df63, along with related issue GH-24661. Reproduce the supplied dl() and OPcache file cache commands using the example scripts, then trace how functions added by the extension affect cached calls. Done means repeated runs call dl_test_test2() and print "Hello World" without a crash or calling a different function.
索引モデルが issue の本文から書いたものです。
説明
Description
Quoted text written with an LLM and checked by a human developer.
A script in the file cache can crash or call the wrong function if it calls a function loaded with
dl(), and that function has a different position in the function table on a later run.d6541df63 (GH-24664) removed the reset of the
ZEND_INIT_FCALLoffset fromzend_file_cache.c. The old comment said the reset could go once system ID validation was in place. The system ID is finalized at startup, so it does not cover functions added later bydl().
main.php:
<?php
if (isset($argv[1])) {
function a() {}
function b() {}
}
dl('dl_test');
include __DIR__ . '/call.php';
call.php:
<?php
var_dump(dl_test_test2());
With dl_test built as a shared extension:
PHP="php -d opcache.enable_cli=1 -d opcache.file_cache=/tmp/fc -d opcache.file_cache_only=1 -d opcache.file_update_protection=0"
$PHP main.php x
$PHP main.php
Resulted in this output:
string(11) "Hello World"
Segmentation fault
But I expected this output instead:
string(11) "Hello World"
string(11) "Hello World"
With only function a() {}, the second run calls a different function:
Fatal error: Uncaught ArgumentCountError: dl_test_frameless() expects exactly 1 argument, 0 given
Tested on debug and release builds of PHP-8.4 at 3ace94211. An earlier build at 2f6fd1167, without d6541df63, prints the expected output. The reset is also gone from the sources of php-8.4.28RC1, php-8.5.13RC1 and php-8.6.0RC5, which I did not build.
Related: GH-24661
PHP Version
PHP 8.4.28-dev (3ace94211)
Operating System
Ubuntu 26.04
- 主要言語
- C
- スター
- 41.8k
- フォーク
- 8.5k
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 137
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
php/php-src のほかの issue
-
SNMP accepts malformed remote ports対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 半日 初心者へのやさしさ 62/100
php/php-src#25137 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
quoted_printable_encode() produces lines longer than 76 characters for bytes 0xF5 to 0xFF対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
php/php-src#24196 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Feature Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
php/php-src#24183 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
research-radar
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
good first issue help wanted program
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
hffgzktbcc-blip/ounce-core#297 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
virtualsquare/picotcp#88 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信