These are chat archives for HdrHistogram/HdrHistogram
one more to fix ;-)
this one is pretty nasty one, it crashed our wrk2 process randomly. Luckily the crash could be reproduced very easily.
To reproduce, simply try to encode an empty histogram:
+static char* test_string_encode_empty()
if you run it will crash almost every time.
It turns out this bug is corrupting memory at every encode but does not always manifest as a crash. Found the problem thanks to valgrind:
@@ -232,7 +232,7 @@ int hdr_encode_compressed(
int32_t len_to_max = counts_index_for(h, h->max_value) + 1;
int32_t counts_limit = len_to_max < h->counts_len ? len_to_max : h->counts_len;
FAIL_AND_CLEANUP(cleanup, result, ENOMEM);
The valgrind run was clean with the fixed version.