Help? seg-fault...

Michael Wieher michael.wieher at
Tue Jul 1 19:29:02 UTC 2008

hey all.
I'm pretty new to using memcached, but have already found it
incredibly powerful.

I don't run into any problems using it, but when my program exits, it
dies with a seg-fault.

If  I comment this function out, there is no seg-fault:

    int getCachedRequest(char* ans,char* req,iniData* data) {
        memcached_return mcr;
        uint32_t flags;
        size_t size;
        char * cp;
        cp = memcached_get(&(data->mc),req,strlen(req),&size,&flags,&mcr);
        if(mcr==0) {
            return 1;
        return 0;

if I use it, there is.
any suggestions on how or why to diagnose the problem?
as you can see, I have a structure "iniData data" that holds a pointer
to the memcached_st
its pretty simple, straightforward, and as I say, no problems during
execution, works beautifully, but when exiting, something in the
cleanup behind the scenes gets confused and segfaults out.
its nothing a call to _exit() won't .... "fix" but I'd really rather
avoid that if I can.


More information about the memcached mailing list