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

PHP 7: Segfault with Igbinary and Variable References #326

Closed
ssigwart opened this issue Feb 14, 2017 · 3 comments
Closed

PHP 7: Segfault with Igbinary and Variable References #326

ssigwart opened this issue Feb 14, 2017 · 3 comments

Comments

@ssigwart
Copy link

Running the following code produces a segmentation fault:

ini_set('memcached.serializer', 'igbinary');
$memcached = new Memcached();
$memcached->addServer('127.0.0.1', 11211);
$a = 'a';
$b = ['a'=>&$a];
$memcached->setMulti($b, 60);

Here are the version numbers:
PHP: 7.0.15
igbinary: 2.0.1
memcached: 3.0.0
libmemcached: 1.0.18

The segmentation fault does not occur if you remove the reference (i.e. use $b = ['a'=>$a];) or add ini_set('memcached.serializer', 'php');

@sodabrew sodabrew added this to the 3.0.3 milestone Feb 14, 2017
@sodabrew
Copy link
Contributor

Thanks for the bug report!

TysonAndre added a commit to igbinary/igbinary that referenced this issue Feb 15, 2017
- The string de-duplication lookup map wasn't being initialized
  because this was neither an array nor an object, and it was assumed to
  be a scalar(It was actually a reference)
  Affects integrations with other extensions, but standalone igbinary
  shouldn't be affected.

Fixes php-memcached-dev/php-memcached#326
@sodabrew
Copy link
Contributor

@TysonAndre does php-memcached require any code changes to benefit from the bug fix in igbinary? Or just note it for users to upgrade their igbinary versions?

@sodabrew sodabrew removed this from the 3.0.3 milestone Feb 20, 2017
@TysonAndre
Copy link
Contributor

No, php-memcached doesn't require any code changes.

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

3 participants