From 36dda9554a826104653765ec8782e055384c39f1 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 15 Dec 2011 11:50:15 +0100 Subject: [PATCH 1/7] ae_epoll.c typo introduced in the previous commit fixed. --- src/ae_epoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ae_epoll.c b/src/ae_epoll.c index fc6d9ccdd..cac10d67f 100644 --- a/src/ae_epoll.c +++ b/src/ae_epoll.c @@ -13,7 +13,7 @@ static int aeApiCreate(aeEventLoop *eventLoop) { aeApiState *state = zmalloc(sizeof(aeApiState)); if (!state) return -1; - state->events = zmalloc(sizeof(epoll_event)*eventLoop->setsize); + state->events = zmalloc(sizeof(struct epoll_event)*eventLoop->setsize); if (!state->events) { zfree(state); return -1; From 18d0ef4bf010282832e9f4c697a86218fc70f393 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 16 Dec 2011 09:55:01 +0100 Subject: [PATCH 2/7] ae.c: solved a memory leak with no practical effects (since the event loop is never destroyed in Redis). Thanks to @anydot for noticing it. --- src/ae.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ae.c b/src/ae.c index 98ff7a8ee..6ddccdf7e 100644 --- a/src/ae.c +++ b/src/ae.c @@ -86,6 +86,8 @@ aeEventLoop *aeCreateEventLoop(int setsize) { void aeDeleteEventLoop(aeEventLoop *eventLoop) { aeApiFree(eventLoop); + zfree(eventLoop->events); + zfree(eventLoop->fired); zfree(eventLoop); } From a244a13b4c5d74031432aa337d6be21b4f033efd Mon Sep 17 00:00:00 2001 From: antirez Date: Sun, 18 Dec 2011 11:12:58 +0100 Subject: [PATCH 3/7] added assertion in zslInsert() that ensures the inserted element score is not NaN --- src/t_zset.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/t_zset.c b/src/t_zset.c index ccf9962a1..99faae858 100644 --- a/src/t_zset.c +++ b/src/t_zset.c @@ -76,6 +76,7 @@ zskiplistNode *zslInsert(zskiplist *zsl, double score, robj *obj) { unsigned int rank[ZSKIPLIST_MAXLEVEL]; int i, level; + redisAssert(!isnan(score)); x = zsl->header; for (i = zsl->level-1; i >= 0; i--) { /* store rank that is crossed to reach the insert position */ From 0a466a754226d5b13cd555a2893867084ee981d4 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 19 Dec 2011 10:16:37 +0100 Subject: [PATCH 4/7] Fixed memleak in CLIENT INFO, added simple test that will work as regression test on mac os x and in the CI when running over valgrind. This fixes issue #256 --- src/networking.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/networking.c b/src/networking.c index f1c6627ce..bc807c4b9 100644 --- a/src/networking.c +++ b/src/networking.c @@ -997,8 +997,12 @@ sds getAllClientsInfoString(void) { listRewind(server.clients,&li); while ((ln = listNext(&li)) != NULL) { + sds cs; + client = listNodeValue(ln); - o = sdscatsds(o,getClientInfoString(client)); + cs = getClientInfoString(client); + o = sdscatsds(o,cs); + sdsfree(cs); o = sdscatlen(o,"\n",1); } return o; From f4bddefecd70e85cd95c72869a1bd8de3274e79e Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 19 Dec 2011 10:18:21 +0100 Subject: [PATCH 5/7] unit/introspection added among tests executed by default --- tests/test_helper.tcl | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl index 459784cd6..41c3557dc 100644 --- a/tests/test_helper.tcl +++ b/tests/test_helper.tcl @@ -34,6 +34,7 @@ set ::all_tests { unit/slowlog unit/scripting unit/maxmemory + unit/introspection } # Index to the next test to run in the ::all_tests list. set ::next_test 0 From 3ae5a308db4613262ac82abae2ba80115d184ca4 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 19 Dec 2011 10:21:50 +0100 Subject: [PATCH 6/7] unit/introspection.tcl added --- tests/unit/introspection.tcl | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/unit/introspection.tcl diff --git a/tests/unit/introspection.tcl b/tests/unit/introspection.tcl new file mode 100644 index 000000000..db21cbd05 --- /dev/null +++ b/tests/unit/introspection.tcl @@ -0,0 +1,5 @@ +start_server {tags {"introspection"}} { + test {CLIENT LIST} { + r client list + } {*addr=*:* fd=* idle=* flags=N db=9 sub=0 psub=0 qbuf=0 obl=0 oll=0 events=r cmd=client*} +} From 0e59a947287a793719226c2c7505d9fc8e616e1a Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 19 Dec 2011 10:55:31 +0100 Subject: [PATCH 7/7] version bumped to 2.9.2 --- src/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h b/src/version.h index 2a7be04ac..d2ab9dea8 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define REDIS_VERSION "2.9.1" +#define REDIS_VERSION "2.9.2"