php / php/php-src

HashTableIterators of empty hashtables are not poisoned upon destruction

Đang mở
#8,438 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Bug Category: Engine Status: Needs Triage
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

Using the zend_hash_iterators_* API, non-empty arrays are properly marked as poisoned in the HashTableIterator entries when destroyed.

However there is an edge case: if nNumUsed == 0 (thanks to deletion of entries during iteration), then the zend_hash_iterators_remove call is skipped in zend_hash_destroy.

Thus, we either should:
a) fix this by always calling the removal ... or
b) completely remove the auto-removal on destruction and leave it the extension authors responsibility to clear the iterators (making zend_hash_iterators_remove public API)

From the perspective of the code in php-src there is no need to have the auto-removal on free, as every iterating thing holds a reference to it.

PHP Version

master

Operating System

No response

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Rà soát đường đi của zend_hash_destroy cùng với zend_hash_iterators_remove, tập trung vào trường hợp nNumUsed == 0 sau khi xóa trong quá trình lặp. Xác định hành vi dọn dẹp iterator nào mà API cần đảm bảo, sau đó kiểm tra rằng các hashtable rỗng và không rỗng để lại trạng thái poisoned như mong đợi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
c, php
Lĩnh vực
backend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
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
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.