Re: Fix runtime errors from -fsanitize=undefined

Поиск
Список
Период
Сортировка
От didier
Тема Re: Fix runtime errors from -fsanitize=undefined
Дата
Msg-id CAJRYxuKaP5oWOGaUEt8dXEO8kN5=8BuP3+mOUCFDDwUiWc12sA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fix runtime errors from -fsanitize=undefined  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
Hi,

I tested this patch with clang 7 on master.
- On unpatched master I can't reproduce errors with make check-world in:
src/backend/access/heap/heapam.c
src/backend/utils/cache/relcache.c (IIRC I triggered this one in a pg
previous version)
src/backend/utils/misc/guc.c

- I have a hard to reproduce one not in this patched:
src/backend/storage/ipc/shm_mq.c line 727

About the changes
- in
src/fe_utils/print.c
line memset(header_done, false, col_count * sizeof(bool));
is redundant and should be remove not guarded with if (hearder_done),
header_done  is either null or already zeroed, it's pg_malloc0 ed.

In all cases but one patched version shortcut an undefined no ops but in
src/backend/access/transam/clog.c
memcmp 0 bytes return 0 thus current change modifies code path, before
with nsubxids == 0 if branch was taken now it's not.
Could wait more often while taking lock, no idea if it's relevant.

Regards
Didier

On Thu, Jun 6, 2019 at 11:36 AM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
>
> On 2019-06-05 21:30, Robert Haas wrote:
> > On Mon, Jun 3, 2019 at 3:22 PM Peter Eisentraut
> > <peter.eisentraut@2ndquadrant.com> 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
> >
> > Is this as of some particular gcc version?
>
> I used gcc-8.
>
> The option has existed in gcc for quite some time, but in previous
> releases it always tended to hang or get confused somewhere.
>
> --
> Peter Eisentraut              http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>
>



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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Avoid full GIN index scan when possible
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: Avoid full GIN index scan when possible