I have a following simple memcache code:::::
memcached_return *rc = NULL;
char *sur = "SURBHI";
memcached_set(cacheClient, "SB", strlen("SB"), sur, strlen(sur), (time_t)0, (uint32_t)0);
char *value1;
memcached_get(cacheClient, "SB", strlen("SB"), 6, (uint32_t)0, rc);
The call to memcache_get gives segmentation fault. Debugger gave following:
0 0x00007ffff79c434c in memcached_get_by_key () from /usr/lib/libmemcached.so.5
1 0x00007ffff79c454f in memcached_get () from /usr/lib/libmemcached.so.5
Did anyone faced similar issue, or has any idea about the solution?
The last three parameters of
memcached_get
should be the pointers through which you will get informations like value, length and error code. See below: