opcache.file_cache: segfault or wrong function for functions loaded with dl()
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- C
- Star
- 41.8k
- Fork
- 8.5k
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 137
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của php/php-src
-
SNMP accepts malformed remote portsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
php/php-src#25137 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug Status: Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
quoted_printable_encode() produces lines longer than 76 characters for bytes 0xF5 to 0xFFCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug Status: Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
php/php-src#24196 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Feature Status: Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
php/php-src#24183 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Research radar digest 2026-W46Đang mởresearch-radar
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue help wanted program
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
hffgzktbcc-blip/ounce-core#297 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
virtualsquare/picotcp#88 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày