Version: 1.6.9

Steps to reproduce the bug:

  Run the following commands:
    CFLAGS='-DNDEBUG' ./configure
    make

  When compiling test.app, the error of undefined reference to 
`cache_error' would happen.

Path that fixes the bug:
@@ -1,5 +1,8 @@
 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- 
*/
+#ifdef NDEBUG
 #undef NDEBUG
+#define PRODUCT_BUILT_WITH_NDEBUG
+#endif
 #include <pthread.h>
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -236,12 +239,16 @@
     char old = *(p - 1);
     *(p - 1) = 0;
     cache_free(cache, p);
+    #ifndef PRODUCT_BUILT_WITH_NDEBUG
     assert(cache_error == -1);
+    #endif
     *(p - 1) = old;
 
     p[sizeof(uint32_t)] = 0;
     cache_free(cache, p);
+    #ifndef PRODUCT_BUILT_WITH_NDEBUG
     assert(cache_error == 1);
+    #endif
 
     /* restore signal handler */
     sigaction(SIGABRT, &old_action, NULL);




-- 

--- 
You received this message because you are subscribed to the Google Groups 
"memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/memcached/4ef0cbe4-c905-4c46-9beb-512e49326eebn%40googlegroups.com.

Reply via email to