php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61381 Segfault on set/get with invalid SASL credentials
Submitted: 2012-03-14 05:05 UTC Modified: 2021-06-09 11:29 UTC
From: wing dot lia at gmail dot com Assigned: cmb (profile)
Status: Closed Package: memcached (PECL)
PHP Version: 5.3.10 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wing dot lia at gmail dot com
New email:
PHP Version: OS:

 

 [2012-03-14 05:05 UTC] wing dot lia at gmail dot com
Description:
------------
When trying to connect with SASL credentials, if the wrong credentials are 
supplied, get/set, etc causes a segfault

Test script:
---------------
$m = new Memcached;
$m->addServer('localhost', '11211', 1);
$m->setSaslAuthData('bad_username', 'bad_password');
$m->set('testkey', 123);

Expected result:
----------------
Throw some sort of error that can be diagnosed with 
getResultCode/getResultMessage

Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5872359 in getnameinfo () from /lib/libc.so.6



#0  0x00007f3b8c748359 in getnameinfo () from /lib/libc.so.6
#1  0x00007f3b89ed0248 in resolve_names (server=..., laddr=0x7fff30785fa0 
"\327\017", laddr_length=1057, raddr=0x7fff30785b70 "", raddr_length=1057) at 
libmemcached/sasl.cc:77
#2  0x00007f3b89ed0547 in memcached_sasl_authenticate_connection 
(server=0x28f72c0) at libmemcached/sasl.cc:180
#3  0x00007f3b89ebcc5f in _memcached_connect (server=0x28f72c0, 
set_last_disconnected=false) at libmemcached/connect.cc:661
#4  0x00007f3b89ebce62 in memcached_connect_try (server=0x28f72c0) at 
libmemcached/connect.cc:711
#5  0x00007f3b89eca437 in __server_create_with (memc=0x1655f30, self=0x28f72c0, 
hostname=..., port=11211, weight=1, type=MEMCACHED_CONNECTION_TCP) at 
libmemcached/server.cc:142
#6  0x00007f3b89eca5af in memcached_server_clone (destination=0x0, 
source=0x28f1750) at libmemcached/server.cc:203
#7  0x00007f3b89ec7b5f in set_last_disconnected_host (self=0x28f1750) at 
./libmemcached/server.hpp:93
#8  0x00007f3b89ec7c45 in memcached_mark_server_for_timeout (server=0x28f1750) at 
./libmemcached/server.hpp:117
#9  0x00007f3b89ec7ea7 in memcached_quit_server (ptr=0x28f1750, io_death=true) at 
libmemcached/quit.cc:126
#10 0x00007f3b89ec5620 in memcached_io_reset (ptr=0x28f1750) at 
libmemcached/io.cc:748
#11 0x00007f3b89ec97f2 in _read_one_response (ptr=0x28f1750, buffer=0x0, 
buffer_length=0, result=0x1655fc8, numeric_value=@0x7fff30786c38) at 
libmemcached/response.cc:721
#12 0x00007f3b89ec9b7d in memcached_response (ptr=0x28f1750, buffer=0x0, 
buffer_length=0, result=0x0, numeric_value=@0x7fff30786c38) at 
libmemcached/response.cc:808
#13 0x00007f3b89ec98e9 in memcached_response (ptr=0x28f1750, buffer=0x0, 
buffer_length=0, result=0x0) at libmemcached/response.cc:748
#14 0x00007f3b89ed0926 in memcached_sasl_authenticate_connection 
(server=0x28f1750) at libmemcached/sasl.cc:248
#15 0x00007f3b89ebcc5f in _memcached_connect (server=0x28f1750, 
set_last_disconnected=false) at libmemcached/connect.cc:661
#16 0x00007f3b89ebce62 in memcached_connect_try (server=0x28f1750) at 
libmemcached/connect.cc:711
#17 0x00007f3b89eca437 in __server_create_with (memc=0x1655f30, self=0x28f1750, 
hostname=..., port=11211, weight=1, type=MEMCACHED_CONNECTION_TCP) at 
libmemcached/server.cc:142
#18 0x00007f3b89eca5af in memcached_server_clone (destination=0x0, 
source=0x28ebbe0) at libmemcached/server.cc:203
#19 0x00007f3b89ec7b5f in set_last_disconnected_host (self=0x28ebbe0) at 
./libmemcached/server.hpp:93
#20 0x00007f3b89ec7c45 in memcached_mark_server_for_timeout (server=0x28ebbe0) at 
./libmemcached/server.hpp:117
#21 0x00007f3b89ec7ea7 in memcached_quit_server (ptr=0x28ebbe0, io_death=true) at 
libmemcached/quit.cc:126
#22 0x00007f3b89ec5620 in memcached_io_reset (ptr=0x28ebbe0) at 
libmemcached/io.cc:748
#23 0x00007f3b89ec97f2 in _read_one_response (ptr=0x28ebbe0, buffer=0x0, 
buffer_length=0, result=0x1655fc8, numeric_value=@0x7fff30789dd8) at 
libmemcached/response.cc:721
#24 0x00007f3b89ec9b7d in memcached_response (ptr=0x28ebbe0, buffer=0x0, 
buffer_length=0, result=0x0, numeric_value=@0x7fff30789dd8) at 
libmemcached/response.cc:808
#25 0x00007f3b89ec98e9 in memcached_response (ptr=0x28ebbe0, buffer=0x0, 
buffer_length=0, result=0x0) at libmemcached/response.cc:748
#26 0x00007f3b89ed0926 in memcached_sasl_authenticate_connection 
(server=0x28ebbe0) at libmemcached/sasl.cc:248
#27 0x00007f3b89ebcc5f in _memcached_connect (server=0x28ebbe0, 
set_last_disconnected=false) at libmemcached/connect.cc:661
#28 0x00007f3b89ebce62 in memcached_connect_try (server=0x28ebbe0) at 
libmemcached/connect.cc:711


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-09 11:29 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-06-09 11:29 UTC] cmb@php.net
The memcached bug tracker is now on Github[1].  If this is still
an issue with the current memcached version, please report there.

[1] <https://github.com/php-memcached-dev/php-memcached/issues>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 11 07:01:27 2024 UTC