Bug #77632 [Asn->Csd]: FFI Segfaults When Called With Variadics

From: Date: Mon, 18 Feb 2019 15:12:19 +0000
Subject: Bug #77632 [Asn->Csd]: FFI Segfaults When Called With Variadics
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219629@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77632&edit=1

 ID:                 77632
 Updated by:         dmitry@php.net
 Reported by:        ircmaxell@php.net
 Summary:            FFI Segfaults When Called With Variadics
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            *Extensibility Functions
 Operating System:   Linux
 PHP Version:        Next Minor Version
 Assigned To:        dmitry
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5661feb1ef929111ef7765672fcb49813eee86fc
Log: Fixed bug #77632 (FFI Segfaults When Called With Variadics)


Previous Comments:
------------------------------------------------------------------------
[2019-02-18 10:31:38] ircmaxell@php.net

Description:
------------
FFI causes a segfault if called with variadics.

Test script:
---------------
<?php

$libc = FFI::cdef("int printf(const char *format, ...);", "libc.so.6");
$args = ["test"];
$libc->printf(...$args);

Expected result:
----------------
test

Actual result:
--------------
Segmentation fault:

Program received signal SIGSEGV, Segmentation fault.
0x0000555555b0826a in zend_check_arg_send_type (zf=0x55555659b710 <executor_globals+1296>,
arg_num=0, mask=3) at Zend/zend_compile.h:943
943             return UNEXPECTED((zf->common.arg_info[arg_num].pass_by_reference & mask) !=
0);



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=77632&edit=1


Thread (3 messages)

« previous php.bugs (#219629) next »