From b033fb329fc14e6469596821508c487e3ed6ff82 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Thu, 15 Nov 2018 13:00:58 +0300 Subject: [PATCH] Fixed lvlhsh test on 64-bit big-endian systems. The nxt_murmur_hash2() generated 4-byte hash that was stored in uintptr_t, which was 8 bytes long on 64-bit systems. At each iteration, it took the previous key and hashed it again. The problem was that it took only the first 4 bytes of the key, and these 4 bytes were always zero on 64-bit big-endian system. That resulted in equal keys at each iteration. The bug was discovered on IBM/S390x. --- src/test/nxt_lvlhsh_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/nxt_lvlhsh_test.c b/src/test/nxt_lvlhsh_test.c index 3dc56076..2e1e0b20 100644 --- a/src/test/nxt_lvlhsh_test.c +++ b/src/test/nxt_lvlhsh_test.c @@ -131,7 +131,7 @@ nxt_int_t nxt_lvlhsh_test(nxt_thread_t *thr, nxt_uint_t n, nxt_bool_t use_pool) { void *value; - uintptr_t key; + uint32_t key; nxt_mp_t *mp; nxt_nsec_t start, end; nxt_uint_t i;