Re: Fix runtime errors from -fsanitize=undefined

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: Fix runtime errors from -fsanitize=undefined
Дата
Msg-id 20190704233353.GA1397438@rfd.leadboat.com
обсуждение исходный текст
Ответ на Fix runtime errors from -fsanitize=undefined  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: Fix runtime errors from -fsanitize=undefined  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
On Mon, Jun 03, 2019 at 09:21:48PM +0200, Peter Eisentraut wrote:
> After many years of trying, it seems the -fsanitize=undefined checking
> in gcc is now working somewhat reliably.  Attached is a patch that fixes
> all errors of the kind
> 
> runtime error: null pointer passed as argument N, which is declared to
> never be null
> 
> Most of the cases are calls to memcpy(), memcmp(), etc. with a length of
> zero, so one appears to get away with passing a null pointer.

I just saw this proposal.  The undefined behavior in question is strictly
academic.  These changes do remove the need for new users to discover
-fno-sanitize=nonnull-attribute, but they make the code longer and no clearer.
Given the variety of code this touches, I expect future commits will
reintroduce the complained-of usage patterns, prompting yet more commits to
restore the invariant achieved here.  Hence, I'm -0 for this change.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jose Luis Tallon
Дата:
Сообщение: Re: [PATCH] Implement uuid_version()
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.