diff --git a/00-RELEASENOTES b/00-RELEASENOTES index 2b67732a1..1d5486ae8 100644 --- a/00-RELEASENOTES +++ b/00-RELEASENOTES @@ -11,6 +11,34 @@ CRITICAL: There is a critical bug affecting MOST USERS. Upgrade ASAP. SECURITY: There are security fixes in the release. -------------------------------------------------------------------------------- +================================================================================ +Redis 6.0.1 Released Sat May 02 00:06:07 CEST 2020 +================================================================================ + +Upgrade urgency HIGH: This release fixes a crash when builiding against + Libc malloc. + +Here we revert 8110ba888, an optimization that causes a crash due to a +bug in the code. It does not happen with the default allocator because of +differences between Jemalloc and libc malloc, so this escaped all our +testing but was reported by a user. We'll add back the original optimization +that was reverted here later, after checking what happens: it is not a +critical optimization. + +The other commits are minor stuff: + +antirez in commit db73d0998: + Cast printf() argument to the format specifier. + 1 file changed, 3 insertions(+), 1 deletion(-) + +antirez in commit 7c0fe7271: + Revert "optimize memory usage of deferred replies" + 1 file changed, 31 deletions(-) + +antirez in commit 8fe25edc7: + Save a call to stopThreadedIOIfNeeded() for the base case. + 1 file changed, 3 insertions(+), 3 deletions(-) + ================================================================================ Redis 6.0.0 GA Released Thu Apr 30 14:55:02 CEST 2020 ================================================================================ diff --git a/src/networking.cpp b/src/networking.cpp index ae4e4b765..caced9b32 100644 --- a/src/networking.cpp +++ b/src/networking.cpp @@ -566,36 +566,6 @@ void addReplyStatusFormat(client *c, const char *fmt, ...) { sdsfree(s); } -/* Sometimes we are forced to create a new reply node, and we can't append to - * the previous one, when that happens, we wanna try to trim the unused space - * at the end of the last reply node which we won't use anymore. */ -void trimReplyUnusedTailSpace(client *c) { - listNode *ln = listLast(c->reply); - clientReplyBlock *tail = ln? (clientReplyBlock*)listNodeValue(ln): nullptr; - - /* Note that 'tail' may be NULL even if we have a tail node, becuase when - * addDeferredMultiBulkLength() is used */ - if (!tail) return; - - /* We only try to trim the space is relatively high (more than a 1/4 of the - * allocation), otherwise there's a high chance realloc will NOP. - * Also, to avoid large memmove which happens as part of realloc, we only do - * that if the used part is small. */ - if (tail->size - tail->used > tail->size / 4 && - tail->used < PROTO_REPLY_CHUNK_BYTES) - { - size_t old_size = tail->size; - tail = (clientReplyBlock*)zrealloc(tail, tail->used + sizeof(clientReplyBlock)); - /* If realloc was a NOP, we got the same value which has internal frag */ - if (tail == listNodeValue(ln)) return; - /* take over the allocation's internal fragmentation (at least for - * memory usage tracking) */ - tail->size = zmalloc_usable(tail) - sizeof(clientReplyBlock); - c->reply_bytes += tail->size - old_size; - listNodeValue(ln) = tail; - } -} - /* Adds an empty object to the reply list that will contain the multi bulk * length, which is not known when this function is called. */ void *addReplyDeferredLen(client *c) { @@ -603,7 +573,6 @@ void *addReplyDeferredLen(client *c) { * ready to be sent, since we are sure that before returning to the * event loop setDeferredAggregateLen() will be called. */ if (prepareClientToWrite(c, false) != C_OK) return NULL; - trimReplyUnusedTailSpace(c); listAddNodeTail(c->reply,NULL); /* NULL is our placeholder. */ return listLast(c->reply); } diff --git a/src/rdb.cpp b/src/rdb.cpp index cb9714e40..ef61c92a9 100644 --- a/src/rdb.cpp +++ b/src/rdb.cpp @@ -2458,7 +2458,9 @@ int rdbLoadRio(rio *rdb, int rdbflags, rdbSaveInfo *rsi) { serverLog(LL_WARNING,"RDB file was saved with checksum disabled: no check performed."); } else if (cksum != expected) { serverLog(LL_WARNING,"Wrong RDB checksum expected: (%llx) but " - "got (%llx). Aborting now.",expected,cksum); + "got (%llx). Aborting now.", + (unsigned long long)expected, + (unsigned long long)cksum); rdbExitReportCorruptRDB("RDB CRC error"); } }