Skip to content

Segfault while spawning a new process with uv_spawn on PHP 5.5.9 #56

Open
@gplanchat

Description

@gplanchat

Hello,

The following code produces a segmentation fault on Ubuntu 14.04 LTS with kernel version 3.13.0 and PHP 5.5.9 :

<?php

$ioRead = uv_stdio_new(null, Uv::CREATE_PIPE | Uv::INHERIT_STREAM);
$ioWrite = uv_stdio_new(null, Uv::CREATE_PIPE | Uv::INHERIT_STREAM);
$ioError = uv_stdio_new(null, Uv::CREATE_PIPE | Uv::INHERIT_STREAM);

$loop = uv_default_loop();
$command = 'ls';
$args = [];
$stdio = [
    0 => $ioRead,
    1 => $ioWrite,
    2 => $ioError
];
$cwd = getcwd();
$env = [];
$callback = function() {
    var_dump(func_get_args());
};
$flags = 0;
$options = [];

$process = uv_spawn($loop, $command, $args, $stdio, $cwd, $env, $callback, $flags, $options);

uv_run($loop);
PHP 5.5.9-1ubuntu4.3 (cli) (built: Jul  7 2014 16:36:58) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
uv
PHP libuv Extension

libuv Support => enabled
Version => 0.0.2
libuv Version => 0.10
http-parser Version => 2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions