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

Several crashes when building server with ASAN #340

Open
2 tasks done
saygoodbyye opened this issue Oct 22, 2024 · 0 comments
Open
2 tasks done

Several crashes when building server with ASAN #340

saygoodbyye opened this issue Oct 22, 2024 · 0 comments

Comments

@saygoodbyye
Copy link

What happens?

When building server with ASAN and executing make check - we get several test crashes

PostgreSQL build:

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 --with-openssl --enable-debug --enable-cassert --with-icu --with-lz4 --with-libxml

To Reproduce

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
make check

regression.out:

# +++ regress install-check in  +++
# initializing database system by running initdb
# using temp instance on port 55312 with PID 399489
ok 1         - basic                                     336 ms
ok 2         - concurrency                               121 ms
ok 3         - correct_null_conversions                   53 ms
not ok 4     - search_path                                71 ms
# (test process exited with exit code 2)
not ok 5     - execution_error                            21 ms
# (test process exited with exit code 2)
not ok 6     - extensions                                 13 ms
# (test process exited with exit code 2)
not ok 7     - type_support                               13 ms
# (test process exited with exit code 2)
not ok 8     - array_type_support                         13 ms
# (test process exited with exit code 2)
not ok 9     - views                                      13 ms
# (test process exited with exit code 2)
not ok 10    - projection_pushdown_unsupported_type       13 ms
# (test process exited with exit code 2)
not ok 11    - materialized_view                          13 ms
# (test process exited with exit code 2)
not ok 12    - hugeint_conversion                         13 ms
# (test process exited with exit code 2)
not ok 13    - read_functions                             13 ms
# (test process exited with exit code 2)
not ok 14    - duckdb_only_functions                      13 ms
# (test process exited with exit code 2)
not ok 15    - duckdb_recycle                             13 ms
# (test process exited with exit code 2)
not ok 16    - cte                                        13 ms
# (test process exited with exit code 2)
not ok 17    - create_table_as                            13 ms
# (test process exited with exit code 2)
ok 18        - standard_conforming_strings                71 ms
ok 19        - query_filter                              100 ms
not ok 20    - temporary_tables                          322 ms
ok 21        - altered_tables                             82 ms
ok 22        - transaction_errors                         49 ms
ok 23        - secrets                                    49 ms
1..23
# 15 of 23 tests failed.

search_path crashes here and in postmaster.log I see:

src/vendor/pg_ruleutils_17.c:10472:7: runtime error: load of value 88, which is not a valid value for type '_Bool'
2024-10-22 10:06:39.539 UTC postmaster[399489] LOG:  server process (PID 399525) exited with exit code 1
2024-10-22 10:06:39.539 UTC postmaster[399489] DETAIL:  Failed process was running: SELECT count(*) FROM public.read_csv('/home/test/pg_duckdb/test/regression' || '/data/web_page.csv') as (column00 int);

After that I comment search_path test in schedule file and get another crash:

# +++ regress install-check in  +++
# initializing database system by running initdb
# using temp instance on port 55312 with PID 399769
ok 1         - basic                                     337 ms
ok 2         - concurrency                               123 ms
ok 3         - correct_null_conversions                   53 ms
ok 4         - execution_error                            56 ms
ok 5         - extensions                               2890 ms
ok 6         - type_support                              292 ms
ok 7         - array_type_support                        185 ms
ok 8         - views                                     158 ms
ok 9         - projection_pushdown_unsupported_type      145 ms
not ok 10    - materialized_view                         203 ms
# (test process exited with exit code 2)
not ok 11    - hugeint_conversion                         23 ms
# (test process exited with exit code 2)
not ok 12    - read_functions                             14 ms
# (test process exited with exit code 2)
not ok 13    - duckdb_only_functions                      13 ms
# (test process exited with exit code 2)
not ok 14    - duckdb_recycle                             13 ms
# (test process exited with exit code 2)
not ok 15    - cte                                        13 ms
# (test process exited with exit code 2)
not ok 16    - create_table_as                            13 ms
# (test process exited with exit code 2)
not ok 17    - standard_conforming_strings                13 ms
# (test process exited with exit code 2)
not ok 18    - query_filter                               13 ms
# (test process exited with exit code 2)
not ok 19    - temporary_tables                           13 ms
# (test process exited with exit code 2)
not ok 20    - altered_tables                             13 ms
# (test process exited with exit code 2)
not ok 21    - transaction_errors                         13 ms
# (test process exited with exit code 2)
not ok 22    - secrets                                    13 ms
# (test process exited with exit code 2)
1..22
# 13 of 22 tests failed.

materialized_view crashes here and in postmaster.log I see:

src/vendor/pg_ruleutils_17.c:10472:7: runtime error: load of value 236, which is not a valid value for type '_Bool'
2024-10-22 10:12:12.014 UTC postmaster[399769] LOG:  server process (PID 400234) exited with exit code 1
2024-10-22 10:12:12.014 UTC postmaster[399769] DETAIL:  Failed process was running: CREATE MATERIALIZED VIEW mv_csv AS SELECT * FROM read_csv('/home/test/pg_duckdb/test/regression/tmp_check/t_csv.csv') AS (a BIGINT);

These tests have the same thing:

read_functions
duckdb_only_functions
create_table_as

OS:

Ubuntu 24.04

pg_duckdb Version:

master

Postgres Version:

REL_17_STABLE

Hardware:

No response

Full Name:

Egor Chindyaskin

Affiliation:

Postgres Professional

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a source build

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?

  • Yes, I have
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