~axino/redis/+git/trunk:6.2

Last commit made on 2023-10-18
Get this branch:
git clone -b 6.2 https://git.launchpad.net/~axino/redis/+git/trunk

Branch merges

Branch information

Name:
6.2
Repository:
lp:~axino/redis/+git/trunk

Recent commits

91863dd... by Oran Agra <email address hidden>

Redis 6.2.14

2f27ebb... by jachin.cai

Fix compile on macOS 13 (#12611)

Use the __MAC_OS_X_VERSION_MIN_REQUIRED macro to detect the
macOS system version instead of using MAC_OS_X_VERSION_10_6.

From MacOSX14.0.sdk, the default definitions of MAC_OS_X_VERSION_xxx have
been removed in usr/include/AvailabilityMacros.h. It includes AvailabilityVersions.h,
where the following condition must be met:
`#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)`
Only then will MAC_OS_X_VERSION_xxx be defined.
However, in the project, _DARWIN_C_SOURCE is not defined, which leads to the
loss of the definition for MAC_OS_X_VERSION_10_6.

(cherry picked from commit a2b0701d2cf64c62f9bb41c01ad44586f01c2c5b)

89391e4... by sundb <email address hidden>

Skip test for sdsRemoveFreeSpace when mem_allocator is not jemalloc (#11878)

Test `trim on SET with big value` (introduced from #11817) fails under mac m1 with libc mem_allocator.
The reason is that malloc(33000) will allocate 65536 bytes(>42000).
This test still passes under ubuntu with libc mem_allocator.

```
*** [err]: trim on SET with big value in tests/unit/type/string.tcl
Expected [r memory usage key] < 42000 (context: type source line 471 file /Users/iospack/data/redis_fork/tests/unit/type/string.tcl cmd {assert {[r memory usage key] < 42000}} proc ::test)
```

simple test under mac m1 with libc mem_allocator:
```c
void *p = zmalloc(33000);
printf("malloc size: %zu\n", zmalloc_size(p));

# output
malloc size: 65536
```

(cherry picked from commit 3fba3ccd96b066d10401f1f9b65293d59d14082c)
(cherry picked from commit 646069a90080000ebf7e3be6838138a7664154d9)

8f30d2a... by Yossi Gottlieb

Fix issue of listen before chmod on Unix sockets (CVE-2023-45145)

Before this commit, Unix socket setup performed chmod(2) on the socket
file after calling listen(2). Depending on what umask is used, this
could leave the file with the wrong permissions for a short period of
time. As a result, another process could exploit this race condition and
establish a connection that would otherwise not be possible.

We now make sure the socket permissions are set up prior to calling
listen(2).

(cherry picked from commit a11b3bc34a054818f2ac70e50adfc542ca1cba42)
(cherry picked from commit 3ca02a0c541e019d77014424e207123160520cec)

24c0bf5... by Oran Agra <email address hidden>

Redis 6.2.13

b313fa4... by sundb <email address hidden>

Fix alpine tests (partial #12035)

This is a partial cherry-pick from Redis 7.2

1) Fixed `ps -p [pid]` doesn't output `<defunct>` when using procps 4.x causing `replication
  child dies when parent is killed - diskless` test to fail.

(cherry picked from commit 42c8c61813a8c3287b8acb3155473551a491aa2b)
(cherry picked from commit 63fc6c87071d12e3577fc383d5a3f25c60423c8e)

f613873... by sundb <email address hidden>

Re-enable hash downsize rehashing during fork (partial #12276)

This was introduced by the recent change in #11692 which prevented a
down-sizing rehashing while there is a fork.

## Solution
1. Fix the rehashing code, so that the same as it allows rehashing for up-sizing
  during fork when the ratio is extreme, it will allow it for down-sizing as well.

Co-authored-by: Oran Agra <email address hidden>

This is a partial cherry pick of:
(cherry picked from commit b00a2351865bb1d87e2d2701b77c8a68daefb054)
(cherry picked from commit d4c37320382edb342292a3e30250d46896a12016)

405d14f... by Oran Agra <email address hidden>

Lua cjson and cmsgpack integer overflow issues (CVE-2022-24834)

* Fix integer overflows due to using wrong integer size.
* Add assertions / panic when overflow still happens.
* Deletion of dead code to avoid need to maintain it
* Some changes are not because of bugs, but rather paranoia.
* Improve cmsgpack and cjson test coverage.

Co-authored-by: Yossi Gottlieb <email address hidden>

2d4b940... by Oran Agra <email address hidden>

Redis 6.22.12

521e05c... by Oran Agra <email address hidden>

fix false valgrind error on new hash test (#11200)

New test fails on valgrind because strtold("+inf") with valgrind returns a non-inf result
same thing is done in incr.tcl.

(cherry picked from commit c3b7bde91499c2fa6105ff336286dbedbfd42790)