redict/tests/unit/type
yoav-steinberg c7dc17fc0f
Fix possible int overflow when hashing an sds. (#9916)
This caused a crash when adding elements larger than 2GB to a set (same goes for hash keys). See #8455.

Details:
* The fix makes the dict hash functions receive a `size_t` instead of an `int`. In practice the dict hash functions
  call siphash which receives a `size_t` and the callers to the hash function pass a `size_t` to it so the fix is trivial.
* The issue was recreated by attempting to add a >2gb value to a set. Appropriate tests were added where I create
  a set with large elements and check basic functionality on it (SADD, SCARD, SPOP, etc...).
* When I added the tests I also refactored a bit all the tests code which is run under the `--large-memory` flag.
  This removed code duplication for the test framework's `write_big_bulk` and `write_big_bulk` code and also takes
  care of not allocating the test frameworks helper huge string used by these tests when not run under `--large-memory`.
* I also added the _violoations.tcl_ unit tests to be part of the entire test suite and leaned up non relevant list related
  tests that were in there. This was done in this PR because most of the _violations_ tests are "large memory" tests.
2021-12-13 21:16:25 +02:00
..
hash.tcl Replace all usage of ziplist with listpack for t_hash (#8887) 2021-08-10 09:18:49 +03:00
incr.tcl decrby LLONG_MIN caused nagation overflow. (#9577) 2021-10-03 09:38:05 +03:00
list-2.tcl Minor improvements for list-2 test (#8156) 2020-12-08 16:26:38 +02:00
list-3.tcl Fix abnormal compression due to out-of-control recompress (#9849) 2021-11-29 07:57:01 +02:00
list-common.tcl list test split into smaller parts 2011-07-11 11:30:46 +02:00
list.tcl Fix possible int overflow when hashing an sds. (#9916) 2021-12-13 21:16:25 +02:00
set.tcl Fix possible int overflow when hashing an sds. (#9916) 2021-12-13 21:16:25 +02:00
stream-cgroups.tcl Connection leak in external tests. (#9777) 2021-11-15 11:07:43 +02:00
stream.tcl Fix timing issue in strem blocking tests (#9927) 2021-12-10 20:35:51 +02:00
string.tcl Obliterate STRALGO! add LCS (which only works on keys) (#9799) 2021-11-18 10:47:49 +02:00
zset.tcl Improve stability in some blocking command tests (#9856) 2021-11-28 15:37:35 +02:00