012_subtransactions.pl vs clang -fsanitize=undefined - Mailing list pgsql-hackers

From Justin Pryzby
Subject 012_subtransactions.pl vs clang -fsanitize=undefined
Date
Msg-id 20220724205937.GG7789@telsasoft.com
Whole thread Raw
Responses Re: 012_subtransactions.pl vs clang -fsanitize=undefined
List pgsql-hackers
I found that -fsanitize causes the test to fail, going back to REL_10_STABLE,
for any clang in:

1:11.1.0-6
1:12.0.1-19ubuntu3
1:13.0.1-2ubuntu2
1:14.0.0-1ubuntu1

| time ./configure --enable-cassert --enable-debug --enable-tap-tests --with-CC=clang-13 CFLAGS='-fsanitize=undefined'
| time { make -j4 clean; make -j4; } >/dev/null
| time PROVE_TESTS=t/012_subtransactions.pl make -C ./src/test/recovery check
| 
| t/012_subtransactions.pl .. 2/? 
| #   Failed test 'Visible'
| #   at t/012_subtransactions.pl line 111.
| #          got: '-1'
| #     expected: '8128'
| ...
| # Looks like you failed 6 tests of 12.

I haven't found any combination of options which cause it to fail differently,
so I'm not even sure if the problem is in postgres, the test case, clang or
libubsan.  Note that optimization seems to avoid the problem, which is why
"kestrel" shows no issue.
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=kestrel&dt=2022-07-23%2022%3A17%3A48

-- 
Justin



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: psql - factor out echo code
Next
From: Thomas Munro
Date:
Subject: Re: 012_subtransactions.pl vs clang -fsanitize=undefined