pg_filedump icon indicating copy to clipboard operation
pg_filedump copied to clipboard

Test numeric fails if PostgreSQL built with ASAN

Open saygoodbyye opened this issue 2 years ago • 0 comments

I have used this branches:

PostgreSQL - REL_15_STABLE
pg_filedump - master

Server configuration:

PGPREFIX=/tmp/pgsql

CPPFLAGS="-Og -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fno-sanitize=nonnull-attribute -fstack-protector" \
LDFLAGS='-fsanitize=address -fsanitize=undefined -static-libasan' \
./configure --enable-tap-tests --enable-debug --enable-cassert --with-libxml --quiet --prefix="$PGPREFIX"

Perform installcheck:

ASAN_OPTIONS=detect_leaks=0:abort_on_error=1:disable_coredump=0:strict_string_checks=1:check_initialization_order=1:strict_init_order=1:detect_odr_violation=0 make -s installcheck

regression.out:

+++ regress install-check in  +++
(using postmaster on Unix socket, default port)
============== dropping database "contrib_regression" ==============
SET
DROP DATABASE
============== creating database "contrib_regression" ==============
CREATE DATABASE
ALTER DATABASE
ALTER DATABASE
ALTER DATABASE
ALTER DATABASE
ALTER DATABASE
ALTER DATABASE
============== running regression test queries        ==============
test datatypes                    ... ok          561 ms
test float                        ... ok           68 ms
test numeric                      ... FAILED       54 ms
test xml                          ... ok           57 ms

======================
 1 of 4 tests failed. 
======================

The differences that caused some tests to fail can be viewed in the
file "/home/test/work/subtree/pg_filedump/regression.diffs".  A copy of the test summary that you see
above is saved in the file "/home/test/work/subtree/pg_filedump/regression.out".

make: *** [/tmp/pgsql/lib/pgxs/src/makefiles/pgxs.mk:433: installcheck] Error 1

regression.diffs:

diff -U3 /home/test/work/subtree/pg_filedump/expected/numeric.out /home/test/work/subtree/pg_filedump/results/numeric.out
--- /home/test/work/subtree/pg_filedump/expected/numeric.out    2023-12-05 04:12:15.600019718 +0000
+++ /home/test/work/subtree/pg_filedump/results/numeric.out     2023-12-05 06:20:42.591140393 +0000
@@ -17,41 +17,10 @@
 \lo_export :oid :output
 \setenv relname :relname
 \! pg_filedump -D $relname $relname.heap | sed -e "s/logid      ./logid      ./" -e "s/recoff 0x......../recoff 0x......../"
-
-*******************************************************************
-* PostgreSQL File/Block Formatted Dump Utility
-*
-* File: numeric.heap
-* Options used: -D numeric
-*******************************************************************
-
-Block    0 ********************************************************
-<Header> -----
- Block Offset: 0x00000000         Offsets: Lower      52 (0x0034)
- Block: Size 8192  Version    4            Upper    7976 (0x1f28)
- LSN:  logid      . recoff 0x........      Special  8192 (0x2000)
- Items:    7                      Free Space: 7924
- Checksum: 0x0000  Prune XID: 0x00000000  Flags: 0x0004 (ALL_VISIBLE)
- Length (including item array): 52
-
-<Data> -----
- Item   1 -- Length:   27  Offset: 8160 (0x1fe0)  Flags: NORMAL
-COPY: 0
- Item   2 -- Length:   31  Offset: 8128 (0x1fc0)  Flags: NORMAL
-COPY: 12341234
- Item   3 -- Length:   31  Offset: 8096 (0x1fa0)  Flags: NORMAL
-COPY: -567890
- Item   4 -- Length:   27  Offset: 8064 (0x1f80)  Flags: NORMAL
-COPY: NaN
- Item   5 -- Length:   24  Offset: 8040 (0x1f68)  Flags: NORMAL
-COPY: \N
- Item   6 -- Length:   27  Offset: 8008 (0x1f48)  Flags: NORMAL
-COPY: -Infinity
- Item   7 -- Length:   27  Offset: 7976 (0x1f28)  Flags: NORMAL
-COPY: Infinity
-
-
-*** End of File Encountered. Last Block Read: 0 ***
+decode.c:396:12: runtime error: load of misaligned address 0x6250000020f9 for type 'struct NumericData', which requires 2 byte alignment
+0x6250000020f9: note: pointer points here
+ 09 18 00  07 00 80 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
+              ^
 --
 ----------------------------------------------------------------------------------------------
 --

Best regards, Egor Chindyaskin Postgres Professional: http://postgrespro.com/

saygoodbyye avatar Dec 05 '23 06:12 saygoodbyye