Skip to content

Memcached gets a dead loop in func assoc_find #271

Closed
@jiejieling

Description

@jiejieling

OS Ver: CentOS 6.5 x64
Kernel Ver: 2.6.32-431.11.7.el6
Memcached Ver: 1.4.24 and 1.4.36

gdb info:
(gdb) info thread
7 Thread 0x7f103e389700 (LWP 29762) logger_thread (arg=) at logger.c:476

  • 6 Thread 0x7f103d988700 (LWP 29763) assoc_find (key=, nkey=, hv=) at assoc.c:93
    5 Thread 0x7f103cf87700 (LWP 29764) 0x00007f103e93a334 in __lll_lock_wait () from /lib64/libpthread.so.0
    4 Thread 0x7f1034586700 (LWP 29765) 0x00007f103e93a334 in __lll_lock_wait () from /lib64/libpthread.so.0
    3 Thread 0x7f1037fff700 (LWP 29766) 0x00007f103e93a334 in __lll_lock_wait () from /lib64/libpthread.so.0
    2 Thread 0x7f10375fe700 (LWP 29767) 0x00007f103e93768c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
    1 Thread 0x7f103f1aa700 (LWP 29761) 0x00007f103e680f33 in epoll_wait () from /lib64/libc.so.6

In the thread 6(assoc_find):
dead loop in:
(gdb) n
92 while (it) {
(gdb)
93 if ((nkey == it->nkey) && (memcmp(key, ITEM_key(it), nkey) == 0)) {
(gdb)
97 it = it->h_next;

items info:
(gdb) p it
$31 = (item *) 0x7f101a4fd7a0

(gdb) p *it
$30 = {next = 0x7f101a4fd7a0, prev = 0x7f0ffaeee700, h_next = 0x7f101a4fd7a0, time = 166607, exptime = 253007, nbytes = 2378, refcount = 1, nsuffix = 10 '\n',
it_flags = 11 '\v', slabs_clsid = 144 '\220', nkey = 24 '\030', data = 0x7f101a4fd7a0}

it->h_next == it self, so the deap loop coming..

So this is a bug ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions