Help? seg-fault...

Michael Wieher michael.wieher at
Tue Jul 1 20:35:16 UTC 2008

>    sprintf(qstring,"%s%d%lu",code,cur->file,cur->location);
> sprintf is generally not recommended.  It doesn't seem terribly hard to get
> it to exceed your stack buffer here.

It is a guarantee that "code" is never more than 8 characters, file
ranges from 2-digits to 3, max, and location wouldn't ever be more
than 10 characters.  So, I'm looking at a string of max 21 chars, I
made it 32.
These inputs come from controlled static sources, not user input.
However I did recompile w/asserts and they passed w/o issues.

> You seem to be missing symbols from the valgrind output.  Perhaps you should
> compile the debugging symbols in.

I know.  It's a bit of a strange situation, in that I'm actually
compiling a file that is imported into and run by
Python, but the compilation itself of the C++ library is done with -g
... so I'm at a bit of a loss as how to get a different angle on it,
without basically writing a wrapper-driver to compile & test the
sucker at the C/C++ level, before then wrapping it into Python.

thanks though...

More information about the memcached mailing list