Skip to content

v0.1.1

Choose a tag to compare

@danog danog released this 19 Nov 13:20
· 14 commits to master since this release

Fixes a heap use-after-free that corrupted PHP's allocator (zend_mm_heap corrupted, segfaults), reported in danog/AsyncOrm's CI through danog/mongo-php-async-driver, which embeds revolt-rs (#1).

A queued closure's arguments (EventLoop::queue($closure, ...$args)) were given to the call and still reported to the cycle collector as references of the callback fiber. Once the closure dropped an argument, a collection meanwhile visited the freed value (GC_DELREF on the allocator's free-list pointer); a live one was counted twice. Arguments given to the call are no longer reported (by-reference ones still are, as the call's frame refers to them). Regression test: GcTest::testQueuedArgumentDroppedBeforeCollection (reported by ASan before the fix).

Upgrading is recommended for everyone, the extension and embedders alike: any code using EventLoop::queue() (Amp's futures and suspensions do) could hit it.