Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 579934 - dev-libs/libmemcached with >=net-misc/memcached-1.4.23: php: libmemcached/dump.cc:126: memcached_return_t ascii_dump: Assertion `response_rc == MEMCACHED_SUCCESS' failed
Summary: dev-libs/libmemcached with >=net-misc/memcached-1.4.23: php: libmemcached/dum...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-14 08:47 UTC by Dennis G.
Modified: 2018-03-13 14:31 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis G. 2016-04-14 08:47:25 UTC
As the count of memcached's slabs has changed in version 1.4.23 (from 200 to 64) the function ascii_dump (libmemcached/dump.cc) of dev-libs/libmemcached is no longer compatible with >=net-misc/memcached-1.4.23. This function produces a SIGABRT because there (always) fails a libc-assert for the 65th (non-existing) slab. You can see this assertion in libmemcached/dump.cc on line 126 (current libmemcached-1.0.18) where this is happening in a for loop with a fixed count of 200 slabs.

Steps to reproduce:
* Use dev-php/pecl-memcached with PHP
* Call PHP's Memcached::getAllKeys() with a memcached server >=1.4.23
* PHP-FPM child will make a SIGABRT, nginx's returning 502

Expected behavior:
* Get all keys (non-atomic) in PHP and not a SIGABRT

There is also a corresponding bug on launchpad for libmemcached: https://bugs.launchpad.net/libmemcached/+bug/1534062

Output of CLI:
php: libmemcached/dump.cc:126: memcached_return_t ascii_dump(Memcached*, memcached_return_t (**)(const memcached_st*, const char*, size_t, void*), void*, uint32_t): Assertion `response_rc == MEMCACHED_SUCCESS' failed

GDB backtrace from php-fpm:
(gdb) bt
#0  0x00007f7cf77171f7 in raise () from /lib64/libc.so.6
#1  0x00007f7cf771864a in abort () from /lib64/libc.so.6
#2  0x00007f7cf771027d in ?? () from /lib64/libc.so.6
#3  0x00007f7cf7710332 in __assert_fail () from /lib64/libc.so.6                                                                                                                                                                                   
#4  0x00007f7cf224336d in ascii_dump (memc=0x2e2eed0, callback=0x7ffe5044dbf0, context=0x3006838, number_of_callbacks=1) at libmemcached/dump.cc:126                                                                                               
#5  0x00007f7cf22434b3 in memcached_dump (shell=0x2e2eed0, callback=0x7ffe5044dbf0, context=0x3006838, number_of_callbacks=1) at libmemcached/dump.cc:158                                                                                          
#6  0x00007f7cf24c994d in zim_Memcached_getAllKeys () from /usr/lib64/php5.6/lib/extensions/debug-non-zts-20131226/memcached.so                                                                                                                    
#7  0x000000000097e3f6 in execute_internal (execute_data_ptr=0x7f7cfbcdcb10, fci=0x0, return_value_used=1) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_execute.c:1527
#8  0x00007f7cf433a7b7 in xdebug_execute_internal () from /usr/lib64/php5.6/lib/extensions/debug-non-zts-20131226/xdebug.so
#9  0x000000000097f847 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f7cfbcdcb10) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:560
#10 0x000000000097ffeb in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0x7f7cfbcdcb10) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:693
#11 0x000000000098247a in ZEND_USER_OPCODE_SPEC_HANDLER (execute_data=0x7f7cfbcdcb10) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:1330
#12 0x000000000097ee80 in execute_ex (execute_data=0x7f7cfbcdcb10) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:363
#13 0x00007f7cf433a1b2 in xdebug_execute_ex () from /usr/lib64/php5.6/lib/extensions/debug-non-zts-20131226/xdebug.so
#14 0x000000000097ef09 in zend_execute (op_array=0x2eb0bd0) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:388
#15 0x000000000097fa33 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f7cfbcdc9a8) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:592
#16 0x000000000097ffeb in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0x7f7cfbcdc9a8) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:693
#17 0x000000000098247a in ZEND_USER_OPCODE_SPEC_HANDLER (execute_data=0x7f7cfbcdc9a8) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:1330
#18 0x000000000097ee80 in execute_ex (execute_data=0x7f7cfbcdc9a8) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:363
#19 0x00007f7cf433a1b2 in xdebug_execute_ex () from /usr/lib64/php5.6/lib/extensions/debug-non-zts-20131226/xdebug.so
#20 0x000000000097ef09 in zend_execute (op_array=0x2eb0000) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:388
#21 0x000000000097fa33 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f7cfbcdc888) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:592
#22 0x000000000097ffeb in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0x7f7cfbcdc888) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:693
#23 0x000000000098247a in ZEND_USER_OPCODE_SPEC_HANDLER (execute_data=0x7f7cfbcdc888) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:1330
#24 0x000000000097ee80 in execute_ex (execute_data=0x7f7cfbcdc888) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:363
#25 0x00007f7cf433a1b2 in xdebug_execute_ex () from /usr/lib64/php5.6/lib/extensions/debug-non-zts-20131226/xdebug.so
#26 0x000000000097ef09 in zend_execute (op_array=0x2eaf6d0) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:388
#27 0x000000000097fa33 in zend_do_fcall_common_helper_SPEC (execute_data=0x7f7cfbcdc5d8) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:592
#28 0x000000000097ffeb in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0x7f7cfbcdc5d8) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:693
#29 0x000000000098247a in ZEND_USER_OPCODE_SPEC_HANDLER (execute_data=0x7f7cfbcdc5d8) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:1330
#30 0x000000000097ee80 in execute_ex (execute_data=0x7f7cfbcdc5d8) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:363
#31 0x00007f7cf433a1b2 in xdebug_execute_ex () from /usr/lib64/php5.6/lib/extensions/debug-non-zts-20131226/xdebug.so
#32 0x000000000097ef09 in zend_execute (op_array=0x2e42498) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend_vm_execute.h:388
#33 0x00000000009371fa in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/Zend/zend.c:1341
#34 0x0000000000899ad7 in php_execute_script (primary_file=0x7ffe50450870) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/main/main.c:2613
#35 0x0000000000a01b3b in main (argc=5, argv=0x7ffe50452d68) at /var/tmp/portage/dev-lang/php-5.6.20/work/sapis-build/fpm/sapi/fpm/fpm/fpm_main.c:1989
Comment 1 Sernin van de Krol 2017-09-15 07:24:32 UTC
I can confirm this, the memdump tool will also make a SIGABRT.
Comment 2 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2017-09-25 15:28:10 UTC
Does this happen with newer versions (1.4.39 is now stable, 1.5.1 is the next target)?
Comment 3 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2018-02-14 03:11:34 UTC
1.5.2 is stable for some now, and 1.5.5 was just added, does this occur in either of these?  I'm going to close this bug in a month if no response.
Comment 4 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2018-03-13 14:31:24 UTC
closing, feel free to reopen if still applicable.