-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
From discord discussion:
_emalloc will call zend_bailout should PHP's memory limit be reached. In the background, this will do a long jump bypassing any Rust destructors (effectively not freeing memory).
We would simply end up intercepting the bailout (like here: https://gist.github.com/awons/d87db73d1ad5eae1445b9de7e3727c6a) and then panicking. But that panic needs to be caught before it crosses the FFI boundary. And then, in C we would need to again bail to make sure the OOM works as it should.
Long jump located here
Steps to Reproduce
https://github.com/ptondereau/php-rust-bailout-repro
Affected Components
- ext-php-rs
- macros
- cli (cargo-php)
PHP Version
Every PHP version
ext-php-rs
Version
every
Operating System
every
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working