|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78488 OOB in ZEND_FUNCTION(ffi_trampoline)
Submitted: 2019-09-03 13:45 UTC Modified: 2019-09-03 13:46 UTC
From: Assigned: dmitry (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 7.4Git-2019-09-03 (Git) OS: Windows x86
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:


 [2019-09-03 13:45 UTC]
As of commit 77a0fa1[1], x86 Windows debug builds signal stack
memory corruption in ZEND_FUNCTION(ffi_trampoline) when running
callconv.phpt.  The culprit is that we're allocating not enough
space[2], since FFI_SIZEOF_ARG is 4 on x86 Windows, but in
zend_ffi_pass_arg() we're copying doubles (and perhaps even wider
values) to that memory.

I'm somewhat confused to have a constant for the argument size,
since at least some call conventions do not have a fixed argument
size to my knowledge, but at least here we must not use this
constant, but rather the maximum size of the supported argument

[1] <;a=commit;h=77a0fa101ed59f05ea07b03adb1cb66962fc45e7>
[2] <>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-09-03 13:46 UTC]
-Assigned To: +Assigned To: dmitry
 [2019-09-03 13:46 UTC]
Dmitry, could you please have a look at this?
 [2019-09-04 09:17 UTC]
Automatic comment on behalf of
Log: Fixed bug #78488 (OOB in ZEND_FUNCTION(ffi_trampoline)).
 [2019-09-04 09:17 UTC]
-Status: Assigned +Status: Closed
 [2019-09-04 09:17 UTC]
Automatic comment on behalf of
Log: Fixed bug #78488 (OOB in ZEND_FUNCTION(ffi_trampoline)).
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jun 04 00:03:37 2023 UTC