miaozhiqiang / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

dead lock occur when get one key from memcache #324

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.telnet memcached port 
2.get key 
3.get no reply from memcache

What is the expected output? What do you see instead?
The memcache should return a result.

What version of the product are you using? On what operating system?
memcache version:memcached 1.4.10
OS:
CentOS release 5.2 (Final)
Linux CACHE02 2.6.18-92.el5 #1 SMP Tue Jun 10 18:51:06 EDT 2008 x86_64 x86_64 
x86_64 GNU/Linux

Please provide any additional information below.

Original issue reported on code.google.com by sunyz...@gmail.com on 29 May 2013 at 7:57

GoogleCodeExporter commented 8 years ago
[Thread debugging using libthread_db enabled]
[New Thread 47738147628624 (LWP 14085)]
[New Thread 1144318272 (LWP 14090)]
[New Thread 1133828416 (LWP 14089)]
[New Thread 1123338560 (LWP 14088)]
[New Thread 1112848704 (LWP 14087)]
[New Thread 1102358848 (LWP 14086)]
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib64/libnss_files.so.2...done.
Loaded symbols for /lib64/libnss_files.so.2
0x00000035a00d21d8 in epoll_wait () from /lib64/libc.so.6
(gdb) bt
#0  0x00000035a00d21d8 in epoll_wait () from /lib64/libc.so.6
#1  0x00002b6ae7329388 in epoll_dispatch (base=0xf12e2c0, tv=<value optimized 
out>) at epoll.c:404
#2  0x00002b6ae731812c in event_base_loop (base=0xf12e2c0, flags=0) at 
event.c:1565
#3  0x0000000000408550 in main (argc=<value optimized out>, argv=<value 
optimized out>) at memcached.c:5120
(gdb) info threads 
  6 Thread 1102358848 (LWP 14086)  0x00000035a1008969 in pthread_mutex_trylock () from /lib64/libpthread.so.0
  5 Thread 1112848704 (LWP 14087)  0x00000035a10089b4 in pthread_mutex_trylock () from /lib64/libpthread.so.0
  4 Thread 1123338560 (LWP 14088)  0x00000035a100c898 in __lll_mutex_lock_wait () from /lib64/libpthread.so.0
  3 Thread 1133828416 (LWP 14089)  0x00000035a10089b4 in pthread_mutex_trylock () from /lib64/libpthread.so.0
  2 Thread 1144318272 (LWP 14090)  0x00000035a100c898 in __lll_mutex_lock_wait () from /lib64/libpthread.so.0
  1 Thread 47738147628624 (LWP 14085)  0x00000035a00d21d8 in epoll_wait () from /lib64/libc.so.6
(gdb) t 6
[Switching to thread 6 (Thread 1102358848 (LWP 14086))]#0  0x00000035a1008969 
in pthread_mutex_trylock ()
   from /lib64/libpthread.so.0
(gdb) bt
#0  0x00000035a1008969 in pthread_mutex_trylock () from /lib64/libpthread.so.0
#1  0x000000000040d03a in do_item_get (key=0xf260ec4 "yy860918_basic", nkey=14, 
hv=1533454680) at memcached.h:469
#2  0x000000000040ec96 in item_get (key=0xf260ec4 "yy860918_basic", nkey=14) at 
thread.c:359
#3  0x0000000000404b94 in process_get_command (c=0xf260cc0, tokens=0x41b49e90, 
ntokens=1, return_cas=false) at memcached.c:2706
#4  0x00000000004097d9 in process_command (c=0xf260cc0, command=<value 
optimized out>) at memcached.c:3210
#5  0x0000000000409fae in try_read_command (c=0xf260cc0) at memcached.c:3423
#6  0x000000000040acda in event_handler (fd=<value optimized out>, which=14, 
arg=0xf260cc0) at memcached.c:3743
#7  0x00002b6ae73184d9 in event_base_loop (base=0xf13bc60, flags=0) at 
event.c:1315
#8  0x000000000040e534 in worker_libevent (arg=0xf12ee30) at thread.c:259
#9  0x00000035a1006307 in start_thread () from /lib64/libpthread.so.0
#10 0x00000035a00d1ded in clone () from /lib64/libc.so.6
(gdb) t 5
[Switching to thread 5 (Thread 1112848704 (LWP 14087))]#0  0x00000035a10089b4 
in pthread_mutex_trylock ()
   from /lib64/libpthread.so.0
(gdb) bt
#0  0x00000035a10089b4 in pthread_mutex_trylock () from /lib64/libpthread.so.0
#1  0x000000000040d03a in do_item_get (key=0xf1628f4 "q983457546_error", 
nkey=16, hv=2413688821) at memcached.h:469
#2  0x000000000040ec96 in item_get (key=0xf1628f4 "q983457546_error", nkey=16) 
at thread.c:359
#3  0x0000000000404b94 in process_get_command (c=0xf1626f0, tokens=0x4254ae90, 
ntokens=1, return_cas=false) at memcached.c:2706
#4  0x00000000004097d9 in process_command (c=0xf1626f0, command=<value 
optimized out>) at memcached.c:3210
#5  0x0000000000409fae in try_read_command (c=0xf1626f0) at memcached.c:3423
#6  0x000000000040acda in event_handler (fd=<value optimized out>, which=16, 
arg=0xf1626f0) at memcached.c:3743
#7  0x00002b6ae73184d9 in event_base_loop (base=0xf13c460, flags=0) at 
event.c:1315
#8  0x000000000040e534 in worker_libevent (arg=0xf1321b8) at thread.c:259
#9  0x00000035a1006307 in start_thread () from /lib64/libpthread.so.0
#10 0x00000035a00d1ded in clone () from /lib64/libc.so.6
(gdb) t 4
[Switching to thread 4 (Thread 1123338560 (LWP 14088))]#0  0x00000035a100c898 
in __lll_mutex_lock_wait ()
   from /lib64/libpthread.so.0
(gdb) bt
#0  0x00000035a100c898 in __lll_mutex_lock_wait () from /lib64/libpthread.so.0
#1  0x00000035a100a868 in pthread_cond_signal@@GLIBC_2.3.2 () from 
/lib64/libpthread.so.0
#2  0x000000000040dad0 in assoc_insert (it=<value optimized out>, hv=<value 
optimized out>) at assoc.c:139
#3  0x000000000040d2c5 in do_item_link (it=0x2aaaac92d7a0, hv=1349979716) at 
items.c:292
#4  0x0000000000408cac in do_store_item (it=0x2aaaac92d7a0, comm=2, 
c=0xf25a3a0, hv=1349979716) at memcached.c:2342
#5  0x000000000040e99d in store_item (item=0x2aaaac92d7a0, comm=2, c=0xf25a3a0) 
at thread.c:459
#6  0x0000000000406312 in complete_nread (c=0xf25a3a0) at memcached.c:836
#7  0x000000000040b067 in event_handler (fd=<value optimized out>, which=0, 
arg=0xf25a3a0) at memcached.c:3780
#8  0x00002b6ae73184d9 in event_base_loop (base=0xf13cd00, flags=0) at 
event.c:1315
#9  0x000000000040e534 in worker_libevent (arg=0xf135540) at thread.c:259
#10 0x00000035a1006307 in start_thread () from /lib64/libpthread.so.0
#11 0x00000035a00d1ded in clone () from /lib64/libc.so.6
(gdb) t 3
[Switching to thread 3 (Thread 1133828416 (LWP 14089))]#0  0x00000035a10089b4 
in pthread_mutex_trylock ()
   from /lib64/libpthread.so.0
(gdb) bt
#0  0x00000035a10089b4 in pthread_mutex_trylock () from /lib64/libpthread.so.0
#1  0x000000000040d03a in do_item_get (key=0xf250754 "h5286455_basic", nkey=14, 
hv=1156733566) at memcached.h:469
#2  0x000000000040ec96 in item_get (key=0xf250754 "h5286455_basic", nkey=14) at 
thread.c:359
#3  0x0000000000404b94 in process_get_command (c=0xf250550, tokens=0x4394ce90, 
ntokens=1, return_cas=false) at memcached.c:2706
#4  0x00000000004097d9 in process_command (c=0xf250550, command=<value 
optimized out>) at memcached.c:3210
#5  0x0000000000409fae in try_read_command (c=0xf250550) at memcached.c:3423
#6  0x000000000040acda in event_handler (fd=<value optimized out>, which=14, 
arg=0xf250550) at memcached.c:3743
#7  0x00002b6ae73184d9 in event_base_loop (base=0xf13d5a0, flags=0) at 
event.c:1315
#8  0x000000000040e534 in worker_libevent (arg=0xf1388c8) at thread.c:259
#9  0x00000035a1006307 in start_thread () from /lib64/libpthread.so.0
#10 0x00000035a00d1ded in clone () from /lib64/libc.so.6
(gdb) info threads 
  6 Thread 1102358848 (LWP 14086)  0x00000035a1008969 in pthread_mutex_trylock () from /lib64/libpthread.so.0
  5 Thread 1112848704 (LWP 14087)  0x00000035a10089b4 in pthread_mutex_trylock () from /lib64/libpthread.so.0
  4 Thread 1123338560 (LWP 14088)  0x00000035a100c898 in __lll_mutex_lock_wait () from /lib64/libpthread.so.0
* 3 Thread 1133828416 (LWP 14089)  0x00000035a10089b4 in pthread_mutex_trylock 
() from /lib64/libpthread.so.0
  2 Thread 1144318272 (LWP 14090)  0x00000035a100c898 in __lll_mutex_lock_wait () from /lib64/libpthread.so.0
  1 Thread 47738147628624 (LWP 14085)  0x00000035a00d21d8 in epoll_wait () from /lib64/libc.so.6
(gdb) t 2
[Switching to thread 2 (Thread 1144318272 (LWP 14090))]#0  0x00000035a100c898 
in __lll_mutex_lock_wait ()
   from /lib64/libpthread.so.0
(gdb) bt
#0  0x00000035a100c898 in __lll_mutex_lock_wait () from /lib64/libpthread.so.0
#1  0x00000035a100a55e in pthread_cond_wait@@GLIBC_2.3.2 () from 
/lib64/libpthread.so.0
#2  0x000000000040dc90 in assoc_maintenance_thread (arg=<value optimized out>) 
at assoc.c:235
#3  0x00000035a1006307 in start_thread () from /lib64/libpthread.so.0
#4  0x00000035a00d1ded in clone () from /lib64/libc.so.6
(gdb) 

Original comment by sunyz...@gmail.com on 29 May 2013 at 8:18

GoogleCodeExporter commented 8 years ago
Does this happen with the latest version? I think 1.4.10 had a hang in it which 
was fixed.

Original comment by dorma...@rydia.net on 28 Jul 2013 at 2:23