Delayed OOM raised during compilation is dropped when compilation fails
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Start in Zend/zend.c around the zend_execute_script() logic linked in the issue, then compare how delayed OOM is handled in sapi/fuzzer/fuzzer-sapi.c. Reproduce with the provided php -n commands and check the result when compilation fails. Done means the memory limit error is reported instead of the parse error in that case, while the no-) case still reports the memory error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
If the main script exceeds memory_limit while being compiled and compilation then fails, the memory error is never reported. The parse error is reported instead. zend_execute_script() only handles a pending delayed OOM when zend_compile_file() returns an op_array:
https://github.com/php/php-src/blob/31c0ea7d7ff1d1fccb6492e52dab544011628065/Zend/zend.c#L1988-L1993
@bhaak found the same problem in sapi/fuzzer/fuzzer-sapi.c: https://github.com/php/php-src/commit/31c0ea7d7ff1d1fccb6492e52dab544011628065#r206151500. Their fix also applies here: handle the delayed OOM outside the if (op_array) block.
The following code:
php -n -r 'file_put_contents("oom.php", "<?php\n\$a = \x27" . str_repeat("A", 3 << 19) . "\x27;\n)\n");'
php -n -d memory_limit=4M oom.php
Resulted in this output:
Parse error: Unmatched ')' in oom.php on line 3
But I expected this output instead:
Fatal error: Allowed memory size of 4194304 bytes exhausted (tried to allocate 2097152 bytes) in oom.php on line 2
Without the ) line, the memory error is reported.
PHP Version
PHP 8.5.12-dev (cli) (NTS), built from 31c0ea7d7ff1d1fccb6492e52dab544011628065
Operating System
Linux x86_64
- Ngôn ngữ chính
- C
- Star
- 40.7k
- Fork
- 8.3k
- Merge trung bình
- 2 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 147
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
-
sapi/fpm/tests/tester.inc can send SIGUSR2 to pid 0, killing run-tests.phpCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởBug Status: Needs Triage
Độ 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
-
zend_set_local_var() overwrites existing compiled variable (CV) zval without calling zval_ptr_dtor()Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởBug Status: Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
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 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Case-insensitive substr_compare, ksort, krsort are still locale-dependentCó thể đã có người làm @lazerg đã nhận 4 ngày trước. Đang mởBug Extension: standard Status: Verified
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
php/php-src#24552 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
master: part of the mbstring bailout fix got lost in a mergeCó thể đã có người làm @lazerg đã nhận 4 ngày trước. Đang mở
Độ 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
Issue tương tự
-
Độ 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
HexaCluster/credcheck#86 ·
-
Wheels for Python 3.15Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
mongodb/winkerberos#175 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
raspberrypi/linux#7718 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
AOMediaCodec/SVT-AV1#3320 ·