Re: Change GUC hashtable to use simplehash?

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: John Naylor <johncnaylorls(at)gmail(dot)com>, Ants Aasma <ants(dot)aasma(at)cybertec(dot)at>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Junwang Zhao <zhjwpku(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gurjeet Singh <gurjeet(at)singh(dot)im>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Change GUC hashtable to use simplehash?
Date: 2024-03-20 16:01:54
Message-ID: 458350a908d9607f7fc2a15407f4405cc454c970.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2024-03-20 at 14:26 +0700, John Naylor wrote:
> This was the culprit. The search path cache didn't trigger this when
> it went in, but it seems for frontend a read past the end of malloc
> fails -fsantize=address. By the same token, I'm guessing the only
> reason this didn't fail for backend is because almost all strings
> you'd want to use as a hash key won't use a malloc'd external block.
>
> I found that adding __attribute__((no_sanitize_address)) to
> fasthash_accum_cstring_aligned() passes CI. While this kind of
> exception is warned against (for good reason), I think it's fine here
> given that glibc and NetBSD, and probably others, do something
> similar
> for optimized strlen(). Before I write the proper macro for that, are
> there any objections? Better ideas?

It appears that the spelling no_sanitize_address is deprecated in
clang[1] in favor of 'no_sanitize("address")'. It doesn't appear to be
deprecated in gcc[2].

Aside from that, +1.

Regards,
Jeff Davis

[1]
https://clang.llvm.org/docs/AddressSanitizer.html#disabling-instrumentation-with-attribute-no-sanitize-address
[2] https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul Jungwirth 2024-03-20 16:21:44 Re: SQL:2011 application time
Previous Message Greg Sabino Mullane 2024-03-20 15:57:25 Re: Avoiding inadvertent debugging mode for pgbench