Sitelet https://github.com/phpredis/phpredis/issues/1464
Skip to content

Segfault in Redis Cluster with inconsistent configuration #1464

Description

@Gared

Expected behaviour

If one slot is not covered or misconfigured it should throw an exception.

Actual behaviour

The process terminates with a segfault error in syslog:
php-fpm7.1[18642]: segfault at 0 ip 00007f266e5caed1 sp 00007ffe3fb1d9a0 error 4 in redis.so

I'm seeing this behaviour on

  • OS: Debian 8.11
  • Redis: 3.2.11 (Not reproducable with 5.0.0 - You get the error message "Timed out attempting to find data in the correct node")
  • PHP: 7.1.23
  • phpredis: 4.1.1

It would be nice if this segfault could be fixed, but it seems only to happen with redis version 3.x and not 5.x. so I think it is not critical.

Let me know if you need any further informations.

Steps to reproduce, backtrace or example script

First you have to set up your cluster with "cluster-require-full-coverage no" in your config.
Set one slot manually to "importing"
redis-cli -h 127.0.0.1 -p 6400 cluster setslot 8282 importing masterhash2
Connect to the master2 node and delete this slot
redis-cli -h 127.0.0.1 -p 6402 cluster delslots 8282

So your configuration on 6400 should look like this:

bd7c0297192c8abd818194b5d33aa32c32372358 127.0.0.1:6400 myself,master - 0 1542891487000 26 connected 0-5460 [8282-<-53d7dd48351c4122ec8251b99e0eddc60341fefd]
53d7dd48351c4122ec8251b99e0eddc60341fefd 127.0.0.1:6402 master - 0 1542891486000 23 connected 5461-10922
df9034af8ad3c88bb2622ebf75bb9fcda7c4e035 127.0.0.1:6405 master - 0 1542891487550 21 connected 10923-16383

and should look like this on 6402:

bd7c0297192c8abd818194b5d33aa32c32372358 127.0.0.1:6400 master - 0 1542891532551 26 connected 0-5460 8282
53d7dd48351c4122ec8251b99e0eddc60341fefd 127.0.0.1:6402 myself,master - 0 1542891531000 23 connected 5461-8281 8283-10922
df9034af8ad3c88bb2622ebf75bb9fcda7c4e035 127.0.0.1:6405 master - 0 1542891531548 21 connected 10923-16383

This example produces the segfault

$redis = new RedisCluster(null, ['127.0.0.1:6402']);
$redis->setex('test29', 100, 'abc');
$redis->get('test29');

I've checked

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions