php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71997 One-Dimensional arrays cause segmentation faults
Submitted: 2016-04-09 15:14 UTC Modified: 2016-04-11 22:49 UTC
From: beniwtv at relamp dot tk Assigned: laruence (profile)
Status: Closed Package: lua (PECL)
PHP Version: 7.0.5 OS: Ubuntu 16.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
36 + 20 = ?
Subscribe to this entry?

 
 [2016-04-09 15:14 UTC] beniwtv at relamp dot tk
Description:
------------
Hi, 

when passing an an array to a lua function, the module will segfault:
php-fpm7.0[9786]: segfault at 5 ip 00007f6cec54b51c sp 00007ffe1292cc70 error 4 in lua.so[7f6cec547000+6000]

Example: Passing array('hello', 'world');

Passing array('what' => 'hello', 'where' => 'world'); (two-dimensional) works however.

Additionally, PHP 5.6 and lua-1.1.0 works as expected.
Maybe a bug in the upgrade to PHP7?

Test script:
---------------
<?php
$mylua = new \lua();
$mylua->eval(<<<CODE
    function nicefunction(args)
        print(args[1])
        return args[1]
    end
CODE
);

echo $mylua->call("nicefunction", array(array('hello', 'world')));
echo "Done!";


Expected result:
----------------
"hello" is displayed, then "Done!" is displayed

Actual result:
--------------
Segmentation fault (core dumped)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-11 02:57 UTC] laruence@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: laruence
 [2016-04-11 02:57 UTC] laruence@php.net
fixed, and 2.0.1 is rleased in PECL
 [2016-04-11 22:49 UTC] beniwtv at relamp dot tk
Thanks, working beautifully!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 11:01:28 2024 UTC