On Jan 23, 2014, at 5:45 AM, Richard Good <richard.good(a)smilecoms.com> wrote:
Hi
I am re-using the pres shtable pattern from the RLS module.
I've found that the default size of the hash size is 512 when I think it should be 9
(2^9=512) (rls.c line 92 in master)
If you do not set the hash size from the config file the code will bit shift 512 and you
will get an overflow.
Am I correct?
Yes, you're correct. The result is undefined behavior, according to C99. Compiling
with clang I get "warning: shift count >= width of type
[-Wshift-count-overflow]", but the result of the shift is a large int that would
presumably exhaust (or nearly exhaust) shared memory when calling new_shtable.
andrew