Commit d673a1f
authored
The per-page free-slot counter in zend_mm_gc() is stored in a 9-bit field
(ZEND_MM_SRUN_FREE_COUNTER_MASK, max 511). Bin 0 holds 512 slots, so a
fully-free bin-0 page drives the counter to 512, which overflows the field
and reads back as 0; the counter == bin_elements checks then never fire and
the page is never reclaimed. Widen the field to 10 bits (0x03ff0000); bit 25
was unused and the write side already stays below it for every other bin.
Bin 0 is only reachable where ZEND_MM_MIN_USEABLE_BIN_SIZE == 8 (32-bit, or
heap-protection-disabled builds).
Fixes GH-22516
1 parent 19f9443 commit d673a1f
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
0 commit comments