Bug #68717 Seg Fault when trying to get a DB stored value with caching policy
Submitted: 19 Mar 2013 13:24
Reporter: Joshua Gigg Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Cluster: Memcached Severity:S1 (Critical)
Version:7.2.7 OS:Linux
Assigned to: CPU Architecture:Any

[19 Mar 2013 13:24] Joshua Gigg
Description:
When I try to get a key with a prefix that is set to 'caching' that I have previously written to the database, I get a segfault on memcache.

Stacktrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff68f5700 (LWP 23119)]
0x00007ffff69b2cc9 in do_store_item (engine=0x687c50, it=0x7fffec10f390, cas=0x0, operation=<value optimized out>,
    cookie=0x7fffac0010d0)
    at /pb2/build/sb_0-6353317-1342179684.85/rpm/BUILD/mysql-cluster-gpl-7.2.7/mysql-cluster-gpl-7.2.7/storage/ndb/memcache/extra/memcached/engines/default_engine/items.c:654
654     /pb2/build/sb_0-6353317-1342179684.85/rpm/BUILD/mysql-cluster-gpl-7.2.7/mysql-cluster-gpl-7.2.7/storage/ndb/memcache/extra/memcached/engines/default_engine/items.c: No such file or directory.
        in /pb2/build/sb_0-6353317-1342179684.85/rpm/BUILD/mysql-cluster-gpl-7.2.7/mysql-cluster-gpl-7.2.7/storage/ndb/memcache/extra/memcached/engines/default_engine/items.c
Missing separate debuginfos, use: debuginfo-install MySQL-Cluster-server-gpl-7.2.7-1.el6.x86_64

(gdb) bt full
#0  0x00007ffff69b2cc9 in do_store_item (engine=0x687c50, it=0x7fffec10f390, cas=0x0, operation=<value optimized out>,
    cookie=0x7fffac0010d0)
    at /pb2/build/sb_0-6353317-1342179684.85/rpm/BUILD/mysql-cluster-gpl-7.2.7/mysql-cluster-gpl-7.2.7/storage/ndb/memcache/extra/memcached/engines/default_engine/items.c:654
        key = <value optimized out>
        old_it = 0x0
        stored = ENGINE_NOT_STORED
        new_it = <value optimized out>
#1  0x00007ffff69b3150 in store_item (engine=0x687c50, item=0x7fffec10f390, cas=0x0, operation=OPERATION_SET,
    cookie=<value optimized out>)
    at /pb2/build/sb_0-6353317-1342179684.85/rpm/BUILD/mysql-cluster-gpl-7.2.7/mysql-cluster-gpl-7.2.7/storage/ndb/memcache/extra/memcached/engines/default_engine/items.c:868
        ret = <value optimized out>
#2  0x00007ffff69c0fb3 in build_hash_item (wqitem=0x793ef0, op=<value optimized out>, exp_time=<value optimized out>)
    at /pb2/build/sb_0-6353317-1342179684.85/rpm/BUILD/mysql-cluster-gpl-7.2.7/mysql-cluster-gpl-7.2.7/storage/ndb/memcache/src/ndb_worker.cc:1122
        status = <value optimized out>
        ncopied = 21
        data_ptr = 0x7fffec10f3cf "a piece of twisty rag\r\n"
        __func__ = "build_hash_item"
        pipeline = @0x793f28
        se = 0x687c50
        nbytes = 23
        item = 0x7fffec10f390
...

How to repeat:
1) Create caching policy/prefix etc. to use caching policy.
2) Write an entry to the table that is storing the keys
3) Try to get this value via memcache