Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Apple M1/Big Sur - Segfault on RETURN_ZVAL in redis.c when in MULTI or PIPELINE mode #1917

@stefan-valnet

Description

@stefan-valnet

Expected behaviour

 $ php redisdebug.php
Array
(
    [0] => value1
    [1] => value2
)

Actual behaviour

 $ php redisdebug.php
zsh: segmentation fault  php redisdebug.php

I'm seeing this behaviour on

  • OS: MacOS Big Sur 11.1 | 11.2 on Apple Silicon
  • Redis: 6.0.10 | 5.0.0
  • PHP: 8.0.1 | 7.4.14 (Compiled from source and via homebrew)
  • phpredis: 5.3.2 | git develop

Steps to reproduce, backtrace or example script

<?php
$redis = new Redis();
$redis->connect('127.0.0.1', 6379, 1, NULL, 100);
$pipe = $redis->multi(Redis::PIPELINE);
$pipe->get("key1");
$pipe->get("key2");
$pipeData = $pipe->exec();
print_r($pipeData);

Interestingly enough, if $pipe contains just one command, the exec succeeds.

Segfault happens in redis.c

PHP_METHOD(Redis, multi)
{
...
    } else {
        php_error_docref(NULL, E_WARNING, "Unknown mode sent to Redis::multi");
        RETURN_FALSE;
    }

--> RETURN_ZVAL(getThis(), 1, 0);
}

I've checked

  • [X ] There is no similar issue from other users
  • [ X] Issue isn't fixed in develop branch

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions