Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASAN alignment error #894

Open
SergeyLubimov opened this issue Jan 13, 2025 · 0 comments
Open

ASAN alignment error #894

SergeyLubimov opened this issue Jan 13, 2025 · 0 comments

Comments

@SergeyLubimov
Copy link

Hello!
I get an ASAN alignment error when running:
#build with ASAN postgresql on branch REL_16_STABLE
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-openssl --prefix=/tmp/REL_16_STABLE --quiet && make -s -j16 world-bin && make install-world-bin -s

export PATH=/tmp/REL_16_STABLE/bin:$PATH
export ASAN_OPTIONS=detect_stack_use_after_return=0: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
export PGDATA=/tmp/data

#build pgcopydb
PG_CONFIG=/tmp/REL_16_STABLE/bin/pg_config make
PG_CONFIG=/tmp/REL_16_STABLE/bin/pg_config make install

initdb -U postgres

echo "port = 5555" > ${PGDATA}/postgresql.auto.conf
pg_ctl -l logfile start

POSTGRESDB="postgres://postgres@localhost:5555/postgres"
SRCDB="postgres://postgres@localhost:5555/srcdb"
TRGDB="postgres://postgres@localhost:5555/trgdb"

psql -d ${POSTGRESDB} <<EOF
create database srcdb;
create database trgdb;
EOF

psql -d ${SRCDB} <<EOF
CREATE TABLE public.my_table
(
fulltext tsvector,
name text
);
CREATE TRIGGER test_fulltext_trigger BEFORE INSERT ON public.my_table FOR EACH ROW EXECUTE FUNCTION tsvector_update_trigger('fulltext', 'pg_catalog.english', 'name');
INSERT INTO public.my_table VALUES ('academi:1', 'name 1');
EOF

pgcopydb clone --use-copy-binary
--source ${SRCDB}
--target ${TRGDB}

pg_ctl stop

Error output:
tsvector.c:91:59: runtime error: member access within misaligned address 0x525000041224 for type 'const struct WordEntryIN', which requires 8 byte alignment
0x525000041224: note: pointer points here
03 00 00 00 09 60 00 00 31 00 01 00 02 00 6e 61 6d 65 00 00 00 00 00 00 7f 7f 7f 7f 7f 7f 7f 7f

Best regards,

Sergey Lubimov

Postgres Professional: https://postgrespro.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant