Bug #77708 [NEW]: FFI Segfaults when using Closure::fromCallable
| From: | ircmaxell@php.net | Date: | Thu, 07 Mar 2019 14:43:03 +0000 |
| Subject: | Bug #77708 [NEW]: FFI Segfaults when using Closure::fromCallable | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-219884@lists.php.net to get a copy of this message | ||
From: ircmaxell
Operating system: linux
PHP version: Next Minor Version
Package: Unknown/Other Function
Bug Type: Bug
Bug description:FFI Segfaults when using Closure::fromCallable
Description:
------------
When attempting to create a closure from an FFI function, it results in
a segfault when trying to call the closure.
Test script:
---------------
<?php
$header = '
int printf(const char*, ...);
';
$ffi = FFI::cdef($header, 'libc.so.6');
$cb = Closure::fromCallable([$ffi, 'printf']);
$cb("Hello World\n");
Expected result:
----------------
Hello World
Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
0x0000555555ae0c0d in zend_closure_call_magic
(execute_data=0x7ffff3a13180, return_value=0x7ffff3a13100) at
/.../Zend/zend_closures.c:249
249 EX(func)->internal_function.scope->__callstatic
: EX(func)->internal_function.scope->__call;
--
Edit bug report at https://bugs.php.net/bug.php?id=77708&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77708&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77708&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77708&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77708&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77708&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77708&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77708&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77708&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77708&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77708&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77708&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77708&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77708&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77708&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77708&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77708&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77708&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77708&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77708&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77708&r=mysqlcfg