nrk/phpiredis

The value of phpiredis_command_bs SET must be string?

ppsleep opened this issue · 4 comments

phpiredis_command_bs($redis, ['SET', 'test', '111']) is ok,
But if phpiredis_command_bs($redis, ['SET', 'test', 111])
My php is 502 Bad Gateway.
The log is:

729 Sep 7 16:20:24 bogon kernel: php-fpm[18478]: segfault at 736964 ip 004142b1 sp bffcbfcc error 4 in libc-2.12.so[399000+190000]
730 Sep 7 16:20:24 bogon abrtd: Directory 'ccpp-2015-09-07-16:20:24-18478' creation detected
731 Sep 7 16:20:24 bogon abrt[18663]: Saved core dump of pid 18478 (/usr/local/php/sbin/php-fpm) to /var/spool/abrt/ccpp-2015-09-07-16:20:24-18478 (150065152 bytes)
732 Sep 7 16:20:25 bogon abrtd: Executable '/usr/local/php/sbin/php-fpm' doesn't belong to any package and ProcessUnpackaged is set to 'no'
733 Sep 7 16:20:25 bogon abrtd: 'post-create' on '/var/spool/abrt/ccpp-2015-09-07-16:20:24-18478' exited with 1
734 Sep 7 16:20:25 bogon abrtd: Deleting problem directory '/var/spool/abrt/ccpp-2015-09-07-16:20:24-18478

THX!

And i cann't use phpiredis_command_bs($redis, ['SELECT', 0])
Must be phpiredis_command_bs($redis, ['SELECT', '0'])

nrk commented

Hmmm it's indeed segfaulting when it should just throw a warning such as:

PHP Warning: phpiredis_command_bs(): Array argument must contain strings

Because yeah phpiredis_command_bs() only accepts string values in the arguments array.

Which version of PHP are you using right now? I've just experienced the same segfault using PHP 5.5, I'm pretty sure it worked with previous versions of PHP but will test later.

Hi,
My PHP version is 5.6.9, And i has update PHP to 5.6.13, there is still the same error.
THX!

nrk commented

I'm closing this issue as this should have been fixed in the php7 branch (which despite the name fixes some things even for PHP 5.x builds).