Hello:
   I found 2 bugs in branches/binary-1.3.0:
   1. First SET 500000 different keys, then GET and CAS them all,
memcached output:"Segmentation fault".(Use "-M" arg)
        ./memcached -B 11500 -M
   2. After fixed it, memcached say: "UNHANDLED ERROR:  130", it
looks like "ERR_OUT_OF_MEMORY" not be handled.
   This is svn diff:

Index: memcached.c
===================================================================
--- memcached.c (revision 658)
+++ memcached.c (working copy)
@@ -885,6 +885,9 @@
        case ERR_NOT_STORED:
            errstr="Not stored.";
            break;
+        case ERR_OUT_OF_MEMORY:
+            errstr="Out of memory.";
+            break;
        default:
            errstr="UNHANDLED ERROR";
            fprintf(stderr, "UNHANDLED ERROR:  %d\n", err);
@@ -1182,7 +1185,7 @@
    */

    it = item_alloc(key, nkey, flags, realtime(exptime), vlen+2);
-    if(cas) {
+    if(it && cas) {
        it->cas_id = (uint64_t)swap64(*((int64_t*)(c->rbuf + 8)));
    }

Thanks!
Robert Q. Liu

On Dec 3, 2007, at 12:32 AM, dormando wrote:

>
> ... is in SVN.
>
> Pulled from Dustin's tree, and gleefully applied all three of his patch
> series into a single svn commit. Dustin; I understand svn branch (yeuch)
> a little better now, and can redo that into three commits in about two
> minutes if you think it's any better ;)
>
> I haven't tested the code, but I gave it a brief review and believe it's
> good as a starting point.
>
> Now we need to:
>
> - Get more peer review. Find the bugs, write tests, etc.
> - Style inconsistencies. Nitpicky but helps combined development
> (memcached could use more of this in general. so obvious 10+ people have
> patched it).
> - Finish any missing features?
> - Performance test, blah blah.
> - Documentation. Binary protocol doc, usage doc, etc.
>
> Uhh. What else? I want to give it a thorough review to understand that
> it doesn't leak memory or overwrite its own buffers, but I've been
> pretty gosh darn sick for the last four days so it hasn't been done by
> me yet. I know a ton of crazy people read this list tho, so please go
> crazy and find out! :)
>
> I'd absolutely love to have the process of hammering out 1.3.0 done
> within two weeks. There's not a lot of code here and the theory's not
> difficult. The potential client benefits are huge.
>
> Thanks!
> -Dormando
>

Attachment: out_of_memory.dpatch
Description: Binary data

Reply via email to