|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59224 [PATCH] FFI Ref sample PHP crash (fixed)
Submitted: 2010-05-20 13:23 UTC Modified: 2017-04-01 20:11 UTC
From: Assigned:
Status: Wont fix Package: ffi (PECL)
PHP Version: 5.2.13 OS: Windows (All)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2010-05-20 13:23 UTC]
Here is the bug fix for Win32/64

Index: ffi_library.c
--- ffi_library.c	(r?vision 299526)
+++ ffi_library.c	(copie de travail)
@@ -395,12 +395,22 @@
 	return func;
-static union _zend_function *php_ffi_method_get(zval 
*object, char *name, int len TSRMLS_DC)
+static union _zend_function *php_ffi_method_get(
+#if PHP_API_VERSION >= 20041225
+	zval **object_pp,
+	zval *object,
+char *name, int len TSRMLS_DC)
 	zend_internal_function *f;
 	php_ffi_context *obj;
 	php_ffi_function *func;
+#if PHP_API_VERSION >= 20041225
+	zval *object = *object_pp;
 	obj = CTX_FETCH(object);
 	func = bind_func(obj, name, len TSRMLS_CC);

Reproduce code:

[lib='kernel32.dll'] DWORD GetTickCount();
$ffi = new ffi($win32_idl);
$count = $ffi->GetTickCount();

echo "$count";

Expected result:
some dword value

Actual result:
[notice] EACCELERATOR(5760): PHP crashed on opline 15 at 

[Thu May 20 19:06:58 2010] [crit] Parent: child process exited 
with status 3 -- Aborting.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-01 19:57 UTC]
Fix applied in:

I'm unable to test this (I don't have a Windows build 
environment handy at the moment); if this works for you, 
please feel free to close the ticket.

 [2017-04-01 20:11 UTC]
-Status: Open +Status: Wont fix
 [2017-04-01 20:11 UTC]
Due to this extension not seeing any activity since 2010, this issue will not be fixed. We are therefore closing this now.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 09:01:28 2024 UTC