Re: Fix runtime errors from -fsanitize=undefined

2019-08-13 Thread Peter Eisentraut
On 2019-07-05 19:10, Tom Lane wrote: > Peter Eisentraut writes: >> On 2019-07-05 01:33, Noah Misch wrote: >>> 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

Re: Fix runtime errors from -fsanitize=undefined

2019-07-05 Thread Tom Lane
Peter Eisentraut writes: > On 2019-07-05 01:33, Noah Misch wrote: >> 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 >> clear

Re: Fix runtime errors from -fsanitize=undefined

2019-07-05 Thread Noah Misch
On Fri, Jul 05, 2019 at 06:14:31PM +0200, Peter Eisentraut wrote: > On 2019-07-05 01:33, Noah Misch wrote: > > 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

Re: Fix runtime errors from -fsanitize=undefined

2019-07-05 Thread Raúl Marín Rodríguez
> This sanitizer has found real problems in the past. By removing these > trivial issues we can then set up a build farm animal or similar to > automatically check for any new issues. We have done exactly this in postgis with 2 different jobs (gcc and clang) and, even though it doesn't happen too

Re: Fix runtime errors from -fsanitize=undefined

2019-07-05 Thread Peter Eisentraut
On 2019-07-05 01:33, Noah Misch wrote: > 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 thi

Re: Fix runtime errors from -fsanitize=undefined

2019-07-04 Thread Noah Misch
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

Re: Fix runtime errors from -fsanitize=undefined

2019-06-29 Thread didier
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 reprodu

Re: Fix runtime errors from -fsanitize=undefined

2019-06-06 Thread Peter Eisentraut
On 2019-06-05 21:30, Robert Haas wrote: > On Mon, Jun 3, 2019 at 3:22 PM 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 > > Is this as of some

Re: Fix runtime errors from -fsanitize=undefined

2019-06-05 Thread Robert Haas
On Mon, Jun 3, 2019 at 3:22 PM 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 Is this as of some particular gcc version? -- Robert Haas Enterpris

Fix runtime errors from -fsanitize=undefined

2019-06-03 Thread Peter Eisentraut
time errors from -fsanitize-undefined These are of the form runtime error: null pointer passed as argument N, which is declared to never be null --- contrib/pgcrypto/px.c | 2 +- src/backend/access/heap/heapam.c| 2 +- src/backend/access/heap/heapam_visibility.c