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

Segfault when re-adding server after resetServerList() and using DISTRIBUTION=CONSISTENT #79

Closed
arjenschol opened this issue Jun 7, 2013 · 7 comments
Labels

Comments

@arjenschol
Copy link
Contributor

Testscript and backtrace @ https://gist.github.com/arjenschol/5729158

@arjenschol
Copy link
Contributor Author

php 5.4.16
php-memcached 2.1.0
libmemcached 1.0.16
Archlinux 3.9.3-1

@degtyaryov
Copy link

Hello.

setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true); var_dump($m->addServer($host, $port, $weight)); var_dump($m->resetServerList()); var_dump($m->addServer($host, $port, $weight)); var_dump($m->getServerList()); ?>

this is promlem exists on fedora 19:
memcached-1.4.15-4.fc19.x86_64
php-pecl-memcached-2.1.0-7.fc19.x86_64
libmemcached-1.0.16-1.fc19.x86_64
php-cli-5.5.3-1.fc19.x86_64

$ php test.php
bool(true)
bool(true)
Segmentation fault

(gdb) bt
#0 0x00007fffe2b36b31 in update_continuum(memcached_st*) () from /lib64/libmemcached.so.11
#1 0x00007fffe2b374a5 in memcached_server_add_with_weight () from /lib64/libmemcached.so.11
#2 0x00007fffe2d5d3a5 in zim_Memcached_addServer () from /usr/lib64/php/modules/memcached.so
#3 0x00005555557714fb in dtrace_execute_internal ()
#4 0x0000555555831245 in zend_do_fcall_common_helper_SPEC ()
#5 0x00005555557ab0b8 in execute_ex ()
#6 0x00005555557713d9 in dtrace_execute_ex ()
#7 0x0000555555782e30 in zend_execute_scripts ()
#8 0x0000555555722b05 in php_execute_script ()
#9 0x0000555555833258 in do_cli ()
#10 0x000055555560dc50 in main ()

on fedora 18 no problem:
memcached-1.4.15-2.fc18.x86_64
libmemcached-1.0.8-2.fc18.x86_64
php-pecl-memcached-2.1.0-3.fc18.x86_64
php-cli-5.4.17-2.fc18.x86_64

$ php test.php
bool(true)
bool(true)
bool(true)
array(1) {
[0]=>
array(2) {
["host"]=>
string(9) "localhost"
["port"]=>
int(11211)
}
}

how to solve this problem?

Thanks.

@degtyaryov
Copy link

backtrace with debuginfo:

(gdb) bt
#0 0x00007fffe2b36b31 in update_continuum (ptr=0x555555f847d0) at libmemcached/hosts.cc:316
#1 0x00007fffe2b374a5 in memcached_server_add_with_weight (shell=0x555555f847d0, hostname=0x7fffbe2d95a0 "localhost", port=11211, weight=0) at libmemcached/hosts.cc:585
#2 0x00007fffe2d5d3a5 in zim_Memcached_addServer () from /usr/lib64/php/modules/memcached.so
#3 0x00005555557714fb in dtrace_execute_internal ()
#4 0x0000555555831245 in zend_do_fcall_common_helper_SPEC ()
#5 0x00005555557ab0b8 in execute_ex ()
#6 0x00005555557713d9 in dtrace_execute_ex ()
#7 0x0000555555782e30 in zend_execute_scripts ()
#8 0x0000555555722b05 in php_execute_script ()
#9 0x0000555555833258 in do_cli ()
#10 0x000055555560dc50 in main ()

@degtyaryov
Copy link

this problem is only present with libmemcached-1.0.16! with libmemcached-1.0.8 all correct.

https://bugs.launchpad.net/libmemcached/+bug/1154159

@mkoppanen
Copy link
Member

Looks like an upstream issue.

@sodabrew
Copy link
Contributor

sodabrew commented Aug 8, 2016

Closing because this was verified as a bug in libmemcached 1.0.16.

@sodabrew sodabrew closed this as completed Aug 8, 2016
@ukautz
Copy link

ukautz commented Feb 16, 2017

If somebody else stumbles across this: I am experiencing this exact issue with libmemached 1.0.18. It's not a php-memcached bug, for sure.

How to fix: In the above mentioned Launchpad page the "continuum patch" linked, which fixes the issue as far as I can tell. It's not part of the official version 1.0.18, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants