Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php8.1 PHP Fatal error: Arginfo / zpp mismatch during call of Redis::pconnect() #2041

Closed
ixqbar opened this issue Dec 6, 2021 · 10 comments
Closed
Assignees

Comments

@ixqbar
Copy link

ixqbar commented Dec 6, 2021

<?php

$redis_handle = new Redis();
$redis_handle->pconnect('127.0.0.1', 6379, 30, 'x1');



PHP Fatal error:  Arginfo / zpp mismatch during call of Redis::pconnect() 

I'm seeing this behaviour on

  • PHP: 8.1
  • phpredis: redis-5.3.5 redis-5.3.6 redis-5.3.7
@ixqbar
Copy link
Author

ixqbar commented Feb 9, 2022

redis.c

ZEND_BEGIN_ARG_INFO_EX(arginfo_pconnect, 0, 0, 1)
    ZEND_ARG_INFO(0, host)
    ZEND_ARG_INFO(0, port)
    ZEND_ARG_INFO(0, timeout)
    ZEND_ARG_INFO(0, persistent_id)
    ZEND_ARG_INFO(0, retry_interval)
    ZEND_ARG_INFO(0, read_timeout)
ZEND_END_ARG_INFO()

@michael-grunder @yatsukhnenko

@matysekmichal
Copy link

I had the same problem. For me it worked to compile php without the --enable-debug flag.

@michael-grunder michael-grunder self-assigned this Oct 13, 2022
@michael-grunder
Copy link
Member

Closing as I believe this is fixed in the develop branch. If you still see this issue please reopen.

@Fryuni
Copy link

Fryuni commented Apr 5, 2023

This problem still happens when php was compiled with enable-debug.

We cannot profile applications that use this extension since profiling requires debug symbols to work.

Although there hasn't been any release since Michael's comment.

@alcohol
Copy link

alcohol commented May 3, 2023

I second what @Fryuni said. Do we need to open a new issue? Can this one be reopened? The issue is still present.

@ClosetGeek-Git
Copy link

ClosetGeek-Git commented Jul 11, 2023

Food for thought:
ZEND_BEGIN_ARG_INFO_EX(arginfo_pconnect, 0, 0, 1) means only 1 parameter (the first) is required. This is handled by zend_parse_method_parameters as follows with the parameter list of "Os|lds!lda"

zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
                                     "Os|lds!lda", &object, redis_ce, &host,
                                     &host_len, &port, &timeout, &persistent_id,
                                     &persistent_id_len, &retry_interval,
                                     &read_timeout, &context)

The list above declares two parameters that are required then 5 that are optional. I know the first parameter in "Os|lds!lda" is the object that the method is called on and is passed using getThis() rather than as a method parameter, but the arginfo doesn't seem to match the actual parameter list.

@VVD
Copy link

VVD commented Jul 11, 2023

Same here:

PHP Fatal error:  Arginfo / zpp mismatch during call of Redis::pconnect() in nextcloud/lib/private/RedisFactory.php on line 137

This line of the nextcloud/lib/private/RedisFactory.php:

$this->instance->pconnect($host, $port, $timeout, null, 0, $readTimeout);

Environment:

  • FreeBSD 13.2-p1 amd64
  • php 8.1.21
  • php81-pecl-redis-5.3.7
  • redis 7.0.12
  • nextcloud 27.0.0.8

nextcloud/config/config.php with unixsocket:

  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => [
      'host' => '/var/run/redis/redis.sock',
      'port' => 0,
  ],

nextcloud/config/config.php with tcp:

  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => [
      'host' => '127.0.0.1',
      'port' => 6379,
      'timeout' => 0.0,
  ],

@VVD
Copy link

VVD commented Jul 11, 2023

Closing as I believe this is fixed in the develop branch. If you still see this issue please reopen.

Can you please point to commit with fix this bug?
Thanks.

@VVD
Copy link

VVD commented Jul 11, 2023

Look like this one: 7cc15ca
AFAIU, it's very hard to apply it to last release 5.3.7.
So request for new release - 5.3.8…

@VVD
Copy link

VVD commented Jul 11, 2023

Oh, missed 2nd post.
So for me workaround is to build with simple patch:

--- redis.c.orig        2022-02-15 18:25:22 UTC
+++ redis.c
@@ -154,6 +154,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_pconnect, 0, 0, 1)
     ZEND_ARG_INFO(0, host)
     ZEND_ARG_INFO(0, port)
     ZEND_ARG_INFO(0, timeout)
+    ZEND_ARG_INFO(0, persistent_id)
+    ZEND_ARG_INFO(0, retry_interval)
+    ZEND_ARG_INFO(0, read_timeout)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_mget, 0, 0, 1)

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Jul 12, 2023
…during call of Redis::pconnect()

Without patch port doesn't work with PHP 8.1 and probably with 8.0, 8.2 and 8.3 too.
Upstream issue: phpredis/phpredis#2041

PR:			272451
Approved by:		Daniel Ylitalo <daniel@blodan.se> (maintainer), arrowd (mentor)
Obtained from:		phpredis/phpredis#2041
Differential Revision:	https://reviews.freebsd.org/D40984
MFH:			2023Q3
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Jul 12, 2023
…during call of Redis::pconnect()

Without patch port doesn't work with PHP 8.1 and probably with 8.0, 8.2 and 8.3 too.
Upstream issue: phpredis/phpredis#2041

PR:			272451
Approved by:		Daniel Ylitalo <daniel@blodan.se> (maintainer), arrowd (mentor)
Obtained from:		phpredis/phpredis#2041
Differential Revision:	https://reviews.freebsd.org/D40984
MFH:			2023Q3
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Jul 12, 2023
…during call of Redis::pconnect()

Without patch port doesn't work with PHP 8.1 and probably with 8.0, 8.2 and 8.3 too.
Upstream issue: phpredis/phpredis#2041

PR:			272451
Approved by:		Daniel Ylitalo <daniel@blodan.se> (maintainer), arrowd (mentor)
Obtained from:		phpredis/phpredis#2041
Differential Revision:	https://reviews.freebsd.org/D40984
MFH:			2023Q3

(cherry picked from commit e858327)
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Jul 12, 2023
…during call of Redis::pconnect()

Without patch port doesn't work with PHP 8.1 and probably with 8.0, 8.2 and 8.3 too.
Upstream issue: phpredis/phpredis#2041

PR:			272451
Approved by:		Daniel Ylitalo <daniel@blodan.se> (maintainer), arrowd (mentor)
Obtained from:		phpredis/phpredis#2041
Differential Revision:	https://reviews.freebsd.org/D40984
MFH:			2023Q3

(cherry picked from commit d3acc2d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants