Re: hash_create(nelem = 0) does invalid memory accesses - Mailing list pgsql-hackers

From Tom Lane
Subject Re: hash_create(nelem = 0) does invalid memory accesses
Date
Msg-id 11967.1475019019@sss.pgh.pa.us
Whole thread Raw
In response to hash_create(nelem = 0) does invalid memory accesses  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> debugging a citus valgrind bleat I noticed that hash_create() accesses
> the result of palloc(0) as an hash element:
> Do we consider this an API usage error that we want to fix?

I think Assert(nelem > 0) would be an appropriate response.
There are probably issues in sizing the hashtable quite aside
from this one.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: LLVM Address Sanitizer (ASAN) and valgrind support
Next
From: Tom Lane
Date:
Subject: Re: LLVM Address Sanitizer (ASAN) and valgrind support