Bug #78761 [NEW]: Zend memory heap corruption with preload and pointer casting
| From: | lisachenko dot it at gmail dot com | Date: | Wed, 30 Oct 2019 11:28:05 +0000 |
| Subject: | Bug #78761 [NEW]: Zend memory heap corruption with preload and pointer casting | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-223515@lists.php.net to get a copy of this message | ||
From: lisachenko dot it at gmail dot com
Operating system: Windows x64
PHP version: 7.4.0RC4
Package: *Extensibility Functions
Bug Type: Bug
Bug description:Zend memory heap corruption with preload and pointer casting
Description:
------------
There is a zend_mm_heap corruption when using FFI preload mode and
proxying requests to the FFI::cast from a preloaded class.
Corruptions appear when trying to cast any CData pointer to another type
via preloaded class that wraps FFI::cast() internally.
Test script:
---------------
See gist:
https://gist.github.com/lisachenko/f133184201aa3c63d58af9548bdd825a
Expected result:
----------------
No memory corruption
Actual result:
--------------
Script terminated with zend_mm_heap corrupted
--
Edit bug report at https://bugs.php.net/bug.php?id=78761&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78761&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78761&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78761&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78761&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78761&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78761&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78761&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78761&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78761&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78761&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78761&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78761&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78761&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78761&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78761&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78761&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78761&r=mysqlcfg