PHP 8.2.0 access violation while executing a 'foreach' loop
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C
- Star
- 40.4k
- Fork
- 8.2k
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 96
Mô tả
Description
Encountered an access violation bug in PHP 8.2.0 while executing a foreach loop on an array. It's inside a complex PHP application. Unfortunateley, I cannot reproduce the error with a small extract of the code just with the loop. Using the extract, it works :-\
I added the extract also to here. But, might not help much as it works. I assigned the variables for the loop with the same values just before the loop which crashes. Background: Application is a house automation server. Loop creates the commands for an i2c command.
What I see:
- The loop just stops before all array elements are executed and PHP exits immediately without calling any error- or exit-handler. The last command in the loop is executed. The next element is not retrieved. The loop is successfully executed ~10 times. In the next attempt, PHP crashes
- No message is written to the prompt
- No entry in the PHP error log is created (all error reporting is enabled)
- A windows access violation event is created. See attachment (partly in German; hope thats not a problem)
- It workes without errors in PHP 8.1.13 (cli) (built: Nov 22 2022 15:49:14) (ZTS Visual C++ 2019 x64)
If I can provide more information, just advise me.
PHP_8.2.0_Crash.txt
PHP_8.2.0_Crash_php.txt
PHP Version
PHP 8.2.0 (cli) (built: Dec 6 2022 15:31:23) (ZTS Visual C++ 2019 x64) - from windows.php.net
Operating System
Windows 10 22H2 Build 19045.2311
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.
Hướng nghiên cứu
Bắt đầu bằng cách xem xét PHP_8.2.0_Crash_php.txt và PHP_8.2.0_Crash.txt, sau đó chạy extract được cung cấp trên PHP 8.2.0 và 8.1.13 trên Windows để xác nhận sự khác biệt. Tiến độ yêu cầu thu gọn lỗi foreach phức tạp thành một trường hợp có thể tái hiện; hoàn thành có nghĩa là có thể tái hiện lỗi vi phạm quyền truy cập và đã xác định được nguyên nhân hoặc bản sửa lỗi của nó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- php
- Lĩnh vực
- backend
- Loại issue
- Lỗi
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 18/100