Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77de5c2b71 | ||
|
|
f20f3ead1b | ||
|
|
8c22086c34 | ||
|
|
92958df3b1 | ||
|
|
0ee28ae40c | ||
|
|
289fadb2d0 | ||
|
|
f4f7d2c37f | ||
|
|
f61d6f0c4a | ||
|
|
473640790f | ||
|
|
9ada818b86 | ||
|
|
381651fac0 | ||
|
|
070d047179 | ||
|
|
0539634777 | ||
|
|
c01abcdebf | ||
|
|
a6d0698b22 | ||
|
|
22b6c28d25 | ||
|
|
9e9d398beb | ||
|
|
3745c5dc81 | ||
|
|
c1cc07b25d | ||
|
|
011dc9f9a5 | ||
|
|
f4e3a940c4 | ||
|
|
44bf2533cd | ||
|
|
2444c82a3f | ||
|
|
e67ad1d1eb | ||
|
|
71536684a7 |
+176
@@ -10,6 +10,182 @@ HIGH: There is a critical bug that may affect a subset of users. Upgrade!
|
||||
CRITICAL: There is a critical bug affecting MOST USERS. Upgrade ASAP.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
================================================================================
|
||||
Redis 3.2.6 Released Tue Dec 06 09:33:29 CET 2016
|
||||
================================================================================
|
||||
|
||||
Upgrade urgency MODERATE: GEORADIUS, BITFIELD and Redis Cluster minor fixes.
|
||||
|
||||
This release mainly fixes three bugs:
|
||||
|
||||
1. A bug with BITFIELD that may cause the bitmap corruption when setting offsets
|
||||
larger than the current string size.
|
||||
|
||||
2. A GEORADIUS bug that may happen when using very large radius lengths, in
|
||||
the range of 10000km or alike, due to wrong bounding box calculation.
|
||||
|
||||
3. A bug with Redis Cluster which crashes when reading a nodes configuration
|
||||
file with zero bytes at the end, which sometimes happens with certain ext4
|
||||
configurations after a system crash.
|
||||
|
||||
The following is the list of commits:
|
||||
|
||||
antirez in commit f20f3ea:
|
||||
Geo: improve fuzz test.
|
||||
1 file changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
antirez in commit 8c22086:
|
||||
Geo: fix computation of bounding box.
|
||||
2 files changed, 33 insertions(+), 27 deletions(-)
|
||||
|
||||
antirez in commit 92958df:
|
||||
Cluster: handle zero bytes at the end of nodes.conf.
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
antirez in commit 0ee28ae:
|
||||
Test: regression test for #3564 added.
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
sunhe in commit 289fadb:
|
||||
bitops.c/bitfieldCommand: update higest_write_offset with check
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
jybaek in commit f4f7d2c:
|
||||
Add missing fclose()
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
================================================================================
|
||||
Redis 3.2.5 Released Wed Oct 26 09:16:40 CEST 2016
|
||||
================================================================================
|
||||
|
||||
Upgrade urgency LOW: This release only fixes a compilation issue due to the
|
||||
missing -ldl at linking time.
|
||||
|
||||
zach shipko in commit 4736407:
|
||||
BSDs don't have -ldl
|
||||
1 file changed, 15 insertions(+), 5 deletions(-)
|
||||
|
||||
antirez in commit 9ada818:
|
||||
Fix modules compilation when libc malloc is used.
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
================================================================================
|
||||
Redis 3.2.4 Released Mon Sep 26 08:58:21 CEST 2016
|
||||
================================================================================
|
||||
|
||||
Upgrade urgency CRITICAL: Redis 3.2 and unstable contained a security
|
||||
vulnerability fixed by this release.
|
||||
|
||||
Hello Redis Wizards of the Memory Stores Empire,
|
||||
|
||||
this is a Redis critical release in order to fix a security issue
|
||||
which is documented clearly here:
|
||||
|
||||
https://github.com/antirez/redis/commit/6d9f8e2462fc2c426d48c941edeb78e5df7d2977
|
||||
|
||||
Thanks to Cory Duplantis of Cisco Talos for reporting the issue.
|
||||
|
||||
IMPACT:
|
||||
|
||||
The gist is that using CONFIG SET calls (or by manipulating redis.conf)
|
||||
an attacker is able to compromise certain fields of the "server" global
|
||||
structure, including the aof filename pointer, that could be made pointing
|
||||
to something else. In turn the AOF name is used in different contexts such
|
||||
as logging, rename(2) and open(2) syscalls, leading to potential problems.
|
||||
|
||||
Please note that since having access to CONFIG SET also means to be able
|
||||
to change the AOF filename (and many other things) directly, this issue
|
||||
actual real world impact is quite small, so I would not panik: if you
|
||||
have CONFIG SET level of access, you can do more and more easily.
|
||||
|
||||
AFFECTED VERSIONS:
|
||||
|
||||
All Redis 3.2.x versions are affected.
|
||||
|
||||
OTHER CHANGES IN THIS RELEASE:
|
||||
|
||||
This release also includes other things:
|
||||
|
||||
* TCP binding bug fixed when only certain addresses were available for
|
||||
a given port.
|
||||
|
||||
* A much better crash report that includes part of the Redis binary:
|
||||
this will allow to fix bugs even when we just have a crash log and
|
||||
no other help from the original poster oft the issue.
|
||||
|
||||
* A fix for Redis Cluster redis-trib displaying of info after creating
|
||||
a new cluster.
|
||||
|
||||
Please check the following list of commits for credits about who did what.
|
||||
Thanks to all the contributors and a special thank to Oran Agra for the
|
||||
help in this release.
|
||||
|
||||
List of commits:
|
||||
|
||||
antirez in commit 0539634:
|
||||
Security: CONFIG SET client-output-buffer-limit overflow fixed.
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
antirez in commit c01abcd:
|
||||
fix the fix for the TCP binding.
|
||||
1 file changed, 15 insertions(+), 10 deletions(-)
|
||||
|
||||
oranagra in commit a6d0698:
|
||||
fix tcp binding when IPv6 is unsupported
|
||||
2 files changed, 14 insertions(+), 10 deletions(-)
|
||||
|
||||
antirez in commit 22b6c28:
|
||||
debug.c: no need to define _GNU_SOURCE, is defined in fmacros.h.
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
antirez in commit 9e9d398:
|
||||
crash log - improve code dump with more info and called symbols.
|
||||
1 file changed, 59 insertions(+), 20 deletions(-)
|
||||
|
||||
oranagra in commit 3745c5d:
|
||||
crash log - add hex dump of function code
|
||||
1 file changed, 22 insertions(+)
|
||||
|
||||
antirez in commit c1cc07b:
|
||||
Sentinel example config: warn about protected mode.
|
||||
1 file changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
rojingeorge in commit 011dc9f:
|
||||
Display the nodes summary once the cluster is established using redis-trib.rb
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
Guo Xiao in commit f4e3a94:
|
||||
Use the standard predefined identifier __func__ (since C99)
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
================================================================================
|
||||
Redis 3.2.3 Released Tue Aug 02 10:55:24 CEST 2016
|
||||
================================================================================
|
||||
|
||||
Upgrade urgency MODERATE: Fix replication delay and redis-cli security issue.
|
||||
|
||||
Hello,
|
||||
|
||||
this is a minor release of Redis addressing two bugs:
|
||||
|
||||
1. There was an inverted if statement logic problem in replication.c causing
|
||||
a replication delay. This is not an actual problem since things work
|
||||
as expected, but worth to fix ASAP anyway.
|
||||
|
||||
2. Redis-cli created the history file with insecure permissions, allowing
|
||||
reding from the file. This was actually a bug in linenoise which is
|
||||
now fixed. The applied fix is from Chris Lamb.
|
||||
|
||||
List of commits:
|
||||
|
||||
Qu Chen in commit e67ad1d:
|
||||
Fix a bug to delay bgsave while AOF rewrite in progress for replication
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
antirez in commit 7153668:
|
||||
Update linenoise to fix insecure redis-cli history file creation.
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
================================================================================
|
||||
Redis 3.2.2 Released Thu Jul 28 14:14:54 CEST 2016
|
||||
================================================================================
|
||||
|
||||
Vendored
+9
-26
@@ -80,35 +80,18 @@ uint8_t geohashEstimateStepsByRadius(double range_meters, double lat) {
|
||||
return step;
|
||||
}
|
||||
|
||||
int geohashBitsComparator(const GeoHashBits *a, const GeoHashBits *b) {
|
||||
/* If step not equal, compare on step. Else, compare on bits. */
|
||||
return a->step != b->step ? a->step - b->step : a->bits - b->bits;
|
||||
}
|
||||
|
||||
/* Return the bounding box of the search area centered at latitude,longitude
|
||||
* having a radius of radius_meter. bounds[0] - bounds[2] is the minimum
|
||||
* and maxium longitude, while bounds[1] - bounds[3] is the minimum and
|
||||
* maximum latitude. */
|
||||
int geohashBoundingBox(double longitude, double latitude, double radius_meters,
|
||||
double *bounds) {
|
||||
if (!bounds) return 0;
|
||||
|
||||
double lonr, latr;
|
||||
lonr = deg_rad(longitude);
|
||||
latr = deg_rad(latitude);
|
||||
|
||||
if (radius_meters > EARTH_RADIUS_IN_METERS)
|
||||
radius_meters = EARTH_RADIUS_IN_METERS;
|
||||
double distance = radius_meters / EARTH_RADIUS_IN_METERS;
|
||||
double min_latitude = latr - distance;
|
||||
double max_latitude = latr + distance;
|
||||
|
||||
/* Note: we're being lazy and not accounting for coordinates near poles */
|
||||
double min_longitude, max_longitude;
|
||||
double difference_longitude = asin(sin(distance) / cos(latr));
|
||||
min_longitude = lonr - difference_longitude;
|
||||
max_longitude = lonr + difference_longitude;
|
||||
|
||||
bounds[0] = rad_deg(min_longitude);
|
||||
bounds[1] = rad_deg(min_latitude);
|
||||
bounds[2] = rad_deg(max_longitude);
|
||||
bounds[3] = rad_deg(max_latitude);
|
||||
bounds[0] = longitude - rad_deg(radius_meters/EARTH_RADIUS_IN_METERS/cos(deg_rad(latitude)));
|
||||
bounds[2] = longitude + rad_deg(radius_meters/EARTH_RADIUS_IN_METERS/cos(deg_rad(latitude)));
|
||||
bounds[1] = latitude - rad_deg(radius_meters/EARTH_RADIUS_IN_METERS);
|
||||
bounds[3] = latitude + rad_deg(radius_meters/EARTH_RADIUS_IN_METERS);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -161,7 +144,7 @@ GeoHashRadius geohashGetAreasByRadius(double longitude, double latitude, double
|
||||
< radius_meters) decrease_step = 1;
|
||||
}
|
||||
|
||||
if (decrease_step) {
|
||||
if (steps > 1 && decrease_step) {
|
||||
steps--;
|
||||
geohashEncode(&long_range,&lat_range,longitude,latitude,steps,&hash);
|
||||
geohashNeighbors(&hash,&neighbors);
|
||||
|
||||
Vendored
+6
-1
@@ -111,6 +111,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
@@ -1160,10 +1161,14 @@ int linenoiseHistorySetMaxLen(int len) {
|
||||
/* Save the history in the specified file. On success 0 is returned
|
||||
* otherwise -1 is returned. */
|
||||
int linenoiseHistorySave(const char *filename) {
|
||||
FILE *fp = fopen(filename,"w");
|
||||
mode_t old_umask = umask(S_IXUSR|S_IRWXG|S_IRWXO);
|
||||
FILE *fp;
|
||||
int j;
|
||||
|
||||
fp = fopen(filename,"w");
|
||||
umask(old_umask);
|
||||
if (fp == NULL) return -1;
|
||||
chmod(filename,S_IRUSR|S_IWUSR);
|
||||
for (j = 0; j < history_len; j++)
|
||||
fprintf(fp,"%s\n",history[j]);
|
||||
fclose(fp);
|
||||
|
||||
+16
-1
@@ -1,5 +1,21 @@
|
||||
# Example sentinel.conf
|
||||
|
||||
# *** IMPORTANT ***
|
||||
#
|
||||
# By default Sentinel will not be reachable from interfaces different than
|
||||
# localhost, either use the 'bind' directive to bind to a list of network
|
||||
# interfaces, or disable protected mode with "protected-mode no" by
|
||||
# adding it to this configuration file.
|
||||
#
|
||||
# Before doing that MAKE SURE the instance is protected from the outside
|
||||
# world via firewalling or other means.
|
||||
#
|
||||
# For example you may use one of the following:
|
||||
#
|
||||
# bind 127.0.0.1 192.168.1.1
|
||||
#
|
||||
# protected-mode no
|
||||
|
||||
# port <sentinel-port>
|
||||
# The port that this sentinel instance will run on
|
||||
port 26379
|
||||
@@ -178,4 +194,3 @@ sentinel failover-timeout mymaster 180000
|
||||
#
|
||||
# sentinel client-reconfig-script mymaster /var/redis/reconfig.sh
|
||||
|
||||
|
||||
|
||||
+15
-5
@@ -65,17 +65,27 @@ ifeq ($(uname_S),SunOS)
|
||||
FINAL_LIBS+= -ldl -lnsl -lsocket -lresolv -lpthread -lrt
|
||||
else
|
||||
ifeq ($(uname_S),Darwin)
|
||||
# Darwin (nothing to do)
|
||||
# Darwin
|
||||
FINAL_LIBS+= -ldl
|
||||
else
|
||||
ifeq ($(uname_S),AIX)
|
||||
# AIX
|
||||
FINAL_LDFLAGS+= -Wl,-bexpall
|
||||
FINAL_LIBS+= -pthread -lcrypt -lbsd
|
||||
|
||||
FINAL_LIBS+=-ldl -pthread -lcrypt -lbsd
|
||||
else
|
||||
ifeq ($(uname_S),OpenBSD)
|
||||
# OpenBSD
|
||||
FINAL_LIBS+= -lpthread
|
||||
else
|
||||
ifeq ($(uname_S),FreeBSD)
|
||||
# FreeBSD
|
||||
FINAL_LIBS+= -lpthread
|
||||
else
|
||||
# All the other OSes (notably Linux)
|
||||
FINAL_LDFLAGS+= -rdynamic
|
||||
FINAL_LIBS+= -pthread
|
||||
FINAL_LIBS+=-ldl -pthread
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -95,7 +105,7 @@ endif
|
||||
ifeq ($(MALLOC),jemalloc)
|
||||
DEPENDENCY_TARGETS+= jemalloc
|
||||
FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
|
||||
FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a -ldl
|
||||
FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a
|
||||
endif
|
||||
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
|
||||
+1
-1
@@ -486,7 +486,7 @@ static int _anetTcpServer(char *err, int port, char *bindaddr, int af, int backl
|
||||
goto end;
|
||||
}
|
||||
if (p == NULL) {
|
||||
anetSetError(err, "unable to bind socket");
|
||||
anetSetError(err, "unable to bind socket, errno: %d", errno);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -907,7 +907,7 @@ void bitfieldCommand(client *c) {
|
||||
struct bitfieldOp *ops = NULL; /* Array of ops to execute at end. */
|
||||
int owtype = BFOVERFLOW_WRAP; /* Overflow type. */
|
||||
int readonly = 1;
|
||||
long higest_write_offset = 0;
|
||||
size_t higest_write_offset = 0;
|
||||
|
||||
for (j = 2; j < c->argc; j++) {
|
||||
int remargs = c->argc-j-1; /* Remaining args other than current. */
|
||||
@@ -957,7 +957,8 @@ void bitfieldCommand(client *c) {
|
||||
|
||||
if (opcode != BITFIELDOP_GET) {
|
||||
readonly = 0;
|
||||
higest_write_offset = bitoffset + bits - 1;
|
||||
if (higest_write_offset < bitoffset + bits - 1)
|
||||
higest_write_offset = bitoffset + bits - 1;
|
||||
/* INCRBY and SET require another argument. */
|
||||
if (getLongLongFromObjectOrReply(c,c->argv[j+3],&i64,NULL) != C_OK){
|
||||
zfree(ops);
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ int clusterLoadConfig(char *filename) {
|
||||
/* Skip blank lines, they can be created either by users manually
|
||||
* editing nodes.conf or by the config writing process if stopped
|
||||
* before the truncate() call. */
|
||||
if (line[0] == '\n') continue;
|
||||
if (line[0] == '\n' || line[0] == '\0') continue;
|
||||
|
||||
/* Split the line into arguments for processing. */
|
||||
argv = sdssplitargs(line,&argc);
|
||||
|
||||
+5
-3
@@ -549,8 +549,9 @@ void loadServerConfigFromString(char *config) {
|
||||
unsigned long long hard, soft;
|
||||
int soft_seconds;
|
||||
|
||||
if (class == -1) {
|
||||
err = "Unrecognized client limit class";
|
||||
if (class == -1 || class == CLIENT_TYPE_MASTER) {
|
||||
err = "Unrecognized client limit class: the user specified "
|
||||
"an invalid one, or 'master' which has no buffer limits.";
|
||||
goto loaderr;
|
||||
}
|
||||
hard = memtoll(argv[2],NULL);
|
||||
@@ -834,7 +835,8 @@ void configSetCommand(client *c) {
|
||||
long val;
|
||||
|
||||
if ((j % 4) == 0) {
|
||||
if (getClientTypeByName(v[j]) == -1) {
|
||||
int class = getClientTypeByName(v[j]);
|
||||
if (class == -1 || class == CLIENT_TYPE_MASTER) {
|
||||
sdsfreesplitres(v,vlen);
|
||||
goto badfmt;
|
||||
}
|
||||
|
||||
+63
-3
@@ -39,6 +39,8 @@
|
||||
#include <ucontext.h>
|
||||
#include <fcntl.h>
|
||||
#include "bio.h"
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
#endif /* HAVE_BACKTRACE */
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
@@ -671,6 +673,8 @@ static void *getMcontextEip(ucontext_t *uc) {
|
||||
return (void*) uc->uc_mcontext.gregs[16]; /* Linux 64 */
|
||||
#elif defined(__ia64__) /* Linux IA64 */
|
||||
return (void*) uc->uc_mcontext.sc_ip;
|
||||
#elif defined(__arm__) /* Linux ARM */
|
||||
return (void*) uc->uc_mcontext.arm_pc;
|
||||
#endif
|
||||
#else
|
||||
return NULL;
|
||||
@@ -972,6 +976,32 @@ int memtest_test_linux_anonymous_maps(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Scans the (assumed) x86 code starting at addr, for a max of `len`
|
||||
* bytes, searching for E8 (callq) opcodes, and dumping the symbols
|
||||
* and the call offset if they appear to be valid. */
|
||||
void dumpX86Calls(void *addr, size_t len) {
|
||||
size_t j;
|
||||
unsigned char *p = addr;
|
||||
Dl_info info;
|
||||
/* Hash table to best-effort avoid printing the same symbol
|
||||
* multiple times. */
|
||||
unsigned long ht[256] = {0};
|
||||
|
||||
if (len < 5) return;
|
||||
for (j = 0; j < len-4; j++) {
|
||||
if (p[j] != 0xE8) continue; /* Not an E8 CALL opcode. */
|
||||
unsigned long target = (unsigned long)addr+j+5;
|
||||
target += *((int32_t*)(p+j+1));
|
||||
if (dladdr((void*)target, &info) != 0 && info.dli_sname != NULL) {
|
||||
if (ht[target&0xff] != target) {
|
||||
printf("Function at 0x%lx is %s\n",target,info.dli_sname);
|
||||
ht[target&0xff] = target;
|
||||
}
|
||||
j += 4; /* Skip the 32 bit immediate. */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sigsegvHandler(int sig, siginfo_t *info, void *secret) {
|
||||
ucontext_t *uc = (ucontext_t*) secret;
|
||||
void *eip = getMcontextEip(uc);
|
||||
@@ -1022,19 +1052,49 @@ void sigsegvHandler(int sig, siginfo_t *info, void *secret) {
|
||||
bioKillThreads();
|
||||
if (memtest_test_linux_anonymous_maps()) {
|
||||
serverLogRaw(LL_WARNING|LL_RAW,
|
||||
"!!! MEMORY ERROR DETECTED! Check your memory ASAP !!!");
|
||||
"!!! MEMORY ERROR DETECTED! Check your memory ASAP !!!\n");
|
||||
} else {
|
||||
serverLogRaw(LL_WARNING|LL_RAW,
|
||||
"Fast memory test PASSED, however your memory can still be broken. Please run a memory test for several hours if possible.");
|
||||
"Fast memory test PASSED, however your memory can still be broken. Please run a memory test for several hours if possible.\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (eip != NULL) {
|
||||
Dl_info info;
|
||||
if (dladdr(eip, &info) != 0) {
|
||||
serverLog(LL_WARNING|LL_RAW,
|
||||
"\n------ DUMPING CODE AROUND EIP ------\n"
|
||||
"Symbol: %s (base: %p)\n"
|
||||
"Module: %s (base %p)\n"
|
||||
"$ xxd -r -p /tmp/dump.hex /tmp/dump.bin\n"
|
||||
"$ objdump --adjust-vma=%p -D -b binary -m i386:x86-64 /tmp/dump.bin\n"
|
||||
"------\n",
|
||||
info.dli_sname, info.dli_saddr, info.dli_fname, info.dli_fbase,
|
||||
info.dli_saddr);
|
||||
size_t len = (long)eip - (long)info.dli_saddr;
|
||||
unsigned long sz = sysconf(_SC_PAGESIZE);
|
||||
if (len < 1<<13) { /* we don't have functions over 8k (verified) */
|
||||
/* Find the address of the next page, which is our "safety"
|
||||
* limit when dumping. Then try to dump just 128 bytes more
|
||||
* than EIP if there is room, or stop sooner. */
|
||||
unsigned long next = ((unsigned long)eip + sz) & ~(sz-1);
|
||||
unsigned long end = (unsigned long)eip + 128;
|
||||
if (end > next) end = next;
|
||||
len = end - (unsigned long)info.dli_saddr;
|
||||
serverLogHexDump(LL_WARNING, "dump of function",
|
||||
info.dli_saddr ,len);
|
||||
dumpX86Calls(info.dli_saddr,len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
serverLogRaw(LL_WARNING|LL_RAW,
|
||||
"\n=== REDIS BUG REPORT END. Make sure to include from START to END. ===\n\n"
|
||||
" Please report the crash by opening an issue on github:\n\n"
|
||||
" http://github.com/antirez/redis/issues\n\n"
|
||||
" Suspect RAM error? Use redis-server --test-memory to verify it.\n\n"
|
||||
);
|
||||
|
||||
/* free(messages); Don't call free() with possibly corrupted memory. */
|
||||
if (server.daemonize && server.supervised == 0) unlink(server.pidfile);
|
||||
|
||||
@@ -1055,7 +1115,7 @@ void serverLogHexDump(int level, char *descr, void *value, size_t len) {
|
||||
unsigned char *v = value;
|
||||
char charset[] = "0123456789abcdef";
|
||||
|
||||
serverLog(level,"%s (hexdump):", descr);
|
||||
serverLog(level,"%s (hexdump of %zu bytes):", descr, len);
|
||||
b = buf;
|
||||
while(len) {
|
||||
b[0] = charset[(*v)>>4];
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
#define D(...) \
|
||||
do { \
|
||||
FILE *fp = fopen("/tmp/log.txt","a"); \
|
||||
fprintf(fp,"%s:%s:%d:\t", __FILE__, __FUNCTION__, __LINE__); \
|
||||
fprintf(fp,"%s:%s:%d:\t", __FILE__, __func__, __LINE__); \
|
||||
fprintf(fp,__VA_ARGS__); \
|
||||
fprintf(fp,"\n"); \
|
||||
fclose(fp); \
|
||||
|
||||
@@ -328,6 +328,7 @@ int membersOfGeoHashBox(robj *zobj, GeoHashBits hash, geoArray *ga, double lon,
|
||||
int membersOfAllNeighbors(robj *zobj, GeoHashRadius n, double lon, double lat, double radius, geoArray *ga) {
|
||||
GeoHashBits neighbors[9];
|
||||
unsigned int i, count = 0, last_processed = 0;
|
||||
int debugmsg = 0;
|
||||
|
||||
neighbors[0] = n.hash;
|
||||
neighbors[1] = n.neighbors.north;
|
||||
@@ -342,8 +343,26 @@ int membersOfAllNeighbors(robj *zobj, GeoHashRadius n, double lon, double lat, d
|
||||
/* For each neighbor (*and* our own hashbox), get all the matching
|
||||
* members and add them to the potential result list. */
|
||||
for (i = 0; i < sizeof(neighbors) / sizeof(*neighbors); i++) {
|
||||
if (HASHISZERO(neighbors[i]))
|
||||
if (HASHISZERO(neighbors[i])) {
|
||||
if (debugmsg) D("neighbors[%d] is zero",i);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Debugging info. */
|
||||
if (debugmsg) {
|
||||
GeoHashRange long_range, lat_range;
|
||||
geohashGetCoordRange(&long_range,&lat_range);
|
||||
GeoHashArea myarea = {{0}};
|
||||
geohashDecode(long_range, lat_range, neighbors[i], &myarea);
|
||||
|
||||
/* Dump center square. */
|
||||
D("neighbors[%d]:\n",i);
|
||||
D("area.longitude.min: %f\n", myarea.longitude.min);
|
||||
D("area.longitude.max: %f\n", myarea.longitude.max);
|
||||
D("area.latitude.min: %f\n", myarea.latitude.min);
|
||||
D("area.latitude.max: %f\n", myarea.latitude.max);
|
||||
D("\n");
|
||||
}
|
||||
|
||||
/* When a huge Radius (in the 5000 km range or more) is used,
|
||||
* adjacent neighbors can be the same, leading to duplicated
|
||||
@@ -352,7 +371,11 @@ int membersOfAllNeighbors(robj *zobj, GeoHashRadius n, double lon, double lat, d
|
||||
if (last_processed &&
|
||||
neighbors[i].bits == neighbors[last_processed].bits &&
|
||||
neighbors[i].step == neighbors[last_processed].step)
|
||||
{
|
||||
if (debugmsg)
|
||||
D("Skipping processing of %d, same as previous\n",i);
|
||||
continue;
|
||||
}
|
||||
count += membersOfGeoHashBox(zobj, neighbors[i], ga, lon, lat, radius);
|
||||
last_processed = i;
|
||||
}
|
||||
|
||||
@@ -1255,6 +1255,7 @@ void cliLoadPreferences(void) {
|
||||
if (argc > 0) cliSetPreferences(argv,argc,0);
|
||||
sdsfreesplitres(argv,argc);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
sdsfree(rcfile);
|
||||
}
|
||||
|
||||
@@ -1305,6 +1305,11 @@ class RedisTrib
|
||||
sleep 1
|
||||
wait_cluster_join
|
||||
flush_nodes_config # Useful for the replicas
|
||||
# Reset the node information, so that when the
|
||||
# final summary is listed in check_cluster about the newly created cluster
|
||||
# all the nodes would get properly listed as slaves or masters
|
||||
reset_nodes
|
||||
load_cluster_info_from_node(argv[0])
|
||||
check_cluster
|
||||
end
|
||||
|
||||
|
||||
+1
-1
@@ -676,7 +676,7 @@ void syncCommand(client *c) {
|
||||
/* Target is disk (or the slave is not capable of supporting
|
||||
* diskless replication) and we don't have a BGSAVE in progress,
|
||||
* let's start one. */
|
||||
if (server.aof_child_pid != -1) {
|
||||
if (server.aof_child_pid == -1) {
|
||||
startBgsaveForReplication(c->slave_capa);
|
||||
} else {
|
||||
serverLog(LL_NOTICE,
|
||||
|
||||
+10
-1
@@ -1776,6 +1776,7 @@ int listenToPort(int port, int *fds, int *count) {
|
||||
if (server.bindaddr_count == 0) server.bindaddr[0] = NULL;
|
||||
for (j = 0; j < server.bindaddr_count || j == 0; j++) {
|
||||
if (server.bindaddr[j] == NULL) {
|
||||
int unsupported = 0;
|
||||
/* Bind * for both IPv6 and IPv4, we enter here only if
|
||||
* server.bindaddr_count == 0. */
|
||||
fds[*count] = anetTcp6Server(server.neterr,port,NULL,
|
||||
@@ -1783,19 +1784,27 @@ int listenToPort(int port, int *fds, int *count) {
|
||||
if (fds[*count] != ANET_ERR) {
|
||||
anetNonBlock(NULL,fds[*count]);
|
||||
(*count)++;
|
||||
} else if (errno == EAFNOSUPPORT) {
|
||||
unsupported++;
|
||||
serverLog(LL_WARNING,"Not listening to IPv6: unsupproted");
|
||||
}
|
||||
|
||||
if (*count == 1 || unsupported) {
|
||||
/* Bind the IPv4 address as well. */
|
||||
fds[*count] = anetTcpServer(server.neterr,port,NULL,
|
||||
server.tcp_backlog);
|
||||
if (fds[*count] != ANET_ERR) {
|
||||
anetNonBlock(NULL,fds[*count]);
|
||||
(*count)++;
|
||||
} else if (errno == EAFNOSUPPORT) {
|
||||
unsupported++;
|
||||
serverLog(LL_WARNING,"Not listening to IPv4: unsupproted");
|
||||
}
|
||||
}
|
||||
/* Exit the loop if we were able to bind * on IPv4 and IPv6,
|
||||
* otherwise fds[*count] will be ANET_ERR and we'll print an
|
||||
* error and return to the caller with an error. */
|
||||
if (*count == 2) break;
|
||||
if (*count + unsupported == 2) break;
|
||||
} else if (strchr(server.bindaddr[j],':')) {
|
||||
/* Bind IPv6 address. */
|
||||
fds[*count] = anetTcp6Server(server.neterr,port,server.bindaddr[j],
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
#define REDIS_VERSION "3.2.2"
|
||||
#define REDIS_VERSION "3.2.6"
|
||||
|
||||
@@ -189,4 +189,13 @@ start_server {tags {"bitops"}} {
|
||||
r set bits 1
|
||||
r bitfield bits get u1 0
|
||||
} {0}
|
||||
|
||||
test {BITFIELD regression for #3564} {
|
||||
for {set j 0} {$j < 10} {incr j} {
|
||||
r del mystring
|
||||
set res [r BITFIELD mystring SET i8 0 10 SET i8 64 10 INCRBY i8 10 99900]
|
||||
assert {$res eq {0 0 60}}
|
||||
}
|
||||
r del mystring
|
||||
}
|
||||
}
|
||||
|
||||
+11
-3
@@ -221,18 +221,26 @@ start_server {tags {"geo"}} {
|
||||
}
|
||||
|
||||
test {GEOADD + GEORANGE randomized test} {
|
||||
set attempt 20
|
||||
set attempt 30
|
||||
while {[incr attempt -1]} {
|
||||
set rv [lindex $regression_vectors $rv_idx]
|
||||
incr rv_idx
|
||||
|
||||
unset -nocomplain debuginfo
|
||||
set srand_seed [randomInt 1000000]
|
||||
set srand_seed [clock milliseconds]
|
||||
if {$rv ne {}} {set srand_seed [lindex $rv 0]}
|
||||
lappend debuginfo "srand_seed is $srand_seed"
|
||||
expr {srand($srand_seed)} ; # If you need a reproducible run
|
||||
r del mypoints
|
||||
set radius_km [expr {[randomInt 200]+10}]
|
||||
|
||||
if {[randomInt 10] == 0} {
|
||||
# From time to time use very big radiuses
|
||||
set radius_km [expr {[randomInt 50000]+10}]
|
||||
} else {
|
||||
# Normally use a few - ~200km radiuses to stress
|
||||
# test the code the most in edge cases.
|
||||
set radius_km [expr {[randomInt 200]+10}]
|
||||
}
|
||||
if {$rv ne {}} {set radius_km [lindex $rv 1]}
|
||||
set radius_m [expr {$radius_km*1000}]
|
||||
geo_random_point search_lon search_lat
|
||||
|
||||
Reference in New Issue
Block a user