[php-src] PR #25087: Fix GH-25086: Io\Poll kqueue backend leaks memory on every modifyEvents()
| From: | lazerg | Date: | Sat, 31 Oct 2026 15:27:14 +0000 |
| Subject: | [php-src] PR #25087: Fix GH-25086: Io\Poll kqueue backend leaks memory on every modifyEvents() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40139@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25087
Author: lazerg
kqueue_backend_modify() only deleted the filters that weren't in the new event
set, so when it got no successful deletes it assumed the fd had no filters before and added the full
new set to filter_count. Going from Read to Read+Write therefore counted the already
registered read filter again. get_suitable_max_events() returns
filter_count, so every wait() grew the struct kevent buffer
by one entry per modify. It now deletes both filters first, which gives the real number of
registered filters, and then adds the requested ones.
Fixes #25086