Closed mfundul closed 1 year ago
More information:
=================================================================
==postgres==104001==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62500001d910 at pc 0x5635723a5543 bp 0x7ffdf9cec400 sp 0x7ffdf9cec3f0
READ of size 8 at 0x62500001d910 thread T0
#0 0x5635723a5542 in is_redundant_derived_clause /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/path/equivclass.c:3087
#1 0x7fe5acedc14c in decompress_chunk_plan_create /home/mfundul/Development/timescale/timescaledb/tsl/src/nodes/decompress_chunk/planner.c:367
#2 0x5635724101a0 in create_customscan_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:4064
#3 0x563572410caf in create_scan_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:744
#4 0x563572405304 in create_plan_recurse /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:394
#5 0x56357240c50e in create_append_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:1177
#6 0x563572405328 in create_plan_recurse /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:403
#7 0x56357240ab4f in create_nestloop_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:4129
#8 0x56357240b507 in create_join_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:1047
#9 0x563572405318 in create_plan_recurse /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:399
#10 0x56357240e861 in create_projection_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:1876
#11 0x5635724053cf in create_plan_recurse /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:415
#12 0x5635724113cc in create_sort_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:2007
#13 0x5635724054c7 in create_plan_recurse /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:465
#14 0x56357240571d in create_plan /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/createplan.c:331
#15 0x5635724585b4 in standard_planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planner.c:412
#16 0x7fe5ad7d7d78 in timescaledb_planner /home/mfundul/Development/timescale/timescaledb/src/planner/planner.c:578
#17 0x56357245b710 in planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planner.c:273
#18 0x56357282b81e in pg_plan_query /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/postgres.c:875
#19 0x563571e2bc28 in ExplainOneQuery /home/mfundul/Development/timescale/postgresql-13.7/src/backend/commands/explain.c:391
#20 0x563571e2e405 in ExplainQuery /home/mfundul/Development/timescale/postgresql-13.7/src/backend/commands/explain.c:275
#21 0x56357283f34e in standard_ProcessUtility /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/utility.c:846
#22 0x7fe5b758e787 in loader_process_utility_hook /home/mfundul/Development/timescale/timescaledb/src/loader/loader.c:582
#23 0x7fe5ad718969 in prev_ProcessUtility /home/mfundul/Development/timescale/timescaledb/src/process_utility.c:95
#24 0x7fe5ad7300b2 in timescaledb_ddl_command_start /home/mfundul/Development/timescale/timescaledb/src/process_utility.c:4410
#25 0x5635728401c6 in ProcessUtility /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/utility.c:520
#26 0x5635728385fb in PortalRunUtility /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/pquery.c:1153
#27 0x5635728395f6 in FillPortalStore /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/pquery.c:1026
#28 0x56357283a2ec in PortalRun /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/pquery.c:760
#29 0x56357282cbc0 in exec_simple_query /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/postgres.c:1239
#30 0x563572831d49 in PostgresMain /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/postgres.c:4347
#31 0x5635725c631f in BackendRun /home/mfundul/Development/timescale/postgresql-13.7/src/backend/postmaster/postmaster.c:4550
#32 0x5635725d10f2 in BackendStartup /home/mfundul/Development/timescale/postgresql-13.7/src/backend/postmaster/postmaster.c:4234
#33 0x5635725d19ca in ServerLoop /home/mfundul/Development/timescale/postgresql-13.7/src/backend/postmaster/postmaster.c:1739
#34 0x5635725d40c1 in PostmasterMain /home/mfundul/Development/timescale/postgresql-13.7/src/backend/postmaster/postmaster.c:1412
#35 0x5635721fdb64 in main /home/mfundul/Development/timescale/postgresql-13.7/src/backend/main/main.c:210
#36 0x7fe5baef9082 in __libc_start_main ../csu/libc-start.c:308
#37 0x56357164046d in _start (/usr/local/pgsql/postgresql-13.7/bin/postgres+0x24e846d)
0x62500001d910 is located 16 bytes to the right of 8192-byte region [0x62500001b900,0x62500001d900)
allocated by thread T0 here:
#0 0x56357172b0f8 in __interceptor_malloc (/usr/local/pgsql/postgresql-13.7/bin/postgres+0x25d30f8)
#1 0x563572de0b4e in AllocSetAlloc /home/mfundul/Development/timescale/postgresql-13.7/src/backend/utils/mmgr/aset.c:919
#2 0x563572e00215 in palloc0 /home/mfundul/Development/timescale/postgresql-13.7/src/backend/utils/mmgr/mcxt.c:994
#3 0x5635721fdcf5 in bms_make_singleton /home/mfundul/Development/timescale/postgresql-13.7/src/backend/nodes/bitmapset.c:196
#4 0x563572529d87 in build_simple_rel /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/util/relnode.c:210
#5 0x7fe5aced114c in decompress_chunk_add_plannerinfo /home/mfundul/Development/timescale/timescaledb/tsl/src/nodes/decompress_chunk/decompress_chunk.c:1101
#6 0x7fe5aced1e57 in ts_decompress_chunk_generate_paths /home/mfundul/Development/timescale/timescaledb/tsl/src/nodes/decompress_chunk/decompress_chunk.c:391
#7 0x7fe5acdb8d02 in tsl_set_rel_pathlist_query /home/mfundul/Development/timescale/timescaledb/tsl/src/planner.c:114
#8 0x7fe5ad7dd8c7 in apply_optimizations /home/mfundul/Development/timescale/timescaledb/src/planner/planner.c:1072
#9 0x7fe5ad7de7f0 in timescaledb_set_rel_pathlist /home/mfundul/Development/timescale/timescaledb/src/planner/planner.c:1219
#10 0x7fe5ad7a47ec in set_rel_pathlist /home/mfundul/Development/timescale/timescaledb/src/import/allpaths.c:251
#11 0x7fe5ad7a4cd4 in ts_set_append_rel_pathlist /home/mfundul/Development/timescale/timescaledb/src/import/allpaths.c:176
#12 0x7fe5ad7dcb31 in reenable_inheritance /home/mfundul/Development/timescale/timescaledb/src/planner/planner.c:1043
#13 0x7fe5ad7de84b in timescaledb_set_rel_pathlist /home/mfundul/Development/timescale/timescaledb/src/planner/planner.c:1173
#14 0x5635723637bc in set_rel_pathlist /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/path/allpaths.c:540
#15 0x563572363c70 in set_base_rel_pathlists /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/path/allpaths.c:352
#16 0x563572365bcb in make_one_rel /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/path/allpaths.c:222
#17 0x5635724298b6 in query_planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planmain.c:269
#18 0x56357244c1b5 in grouping_planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planner.c:2059
#19 0x563572456d4b in subquery_planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planner.c:1015
#20 0x563572458583 in standard_planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planner.c:405
#21 0x7fe5ad7d7d78 in timescaledb_planner /home/mfundul/Development/timescale/timescaledb/src/planner/planner.c:578
#22 0x56357245b710 in planner /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/plan/planner.c:273
#23 0x56357282b81e in pg_plan_query /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/postgres.c:875
#24 0x563571e2bc28 in ExplainOneQuery /home/mfundul/Development/timescale/postgresql-13.7/src/backend/commands/explain.c:391
#25 0x563571e2e405 in ExplainQuery /home/mfundul/Development/timescale/postgresql-13.7/src/backend/commands/explain.c:275
#26 0x56357283f34e in standard_ProcessUtility /home/mfundul/Development/timescale/postgresql-13.7/src/backend/tcop/utility.c:846
#27 0x7fe5b758e787 in loader_process_utility_hook /home/mfundul/Development/timescale/timescaledb/src/loader/loader.c:582
#28 0x7fe5ad718969 in prev_ProcessUtility /home/mfundul/Development/timescale/timescaledb/src/process_utility.c:95
#29 0x7fe5ad7300b2 in timescaledb_ddl_command_start /home/mfundul/Development/timescale/timescaledb/src/process_utility.c:4410
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/mfundul/Development/timescale/postgresql-13.7/src/backend/optimizer/path/equivclass.c:3087 in is_redundant_derived_clause
Shadow bytes around the buggy address:
0x0c4a7fffbad0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c4a7fffbae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c4a7fffbaf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c4a7fffbb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c4a7fffbb10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c4a7fffbb20: fa fa[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c4a7fffbb30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c4a7fffbb40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c4a7fffbb50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c4a7fffbb60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c4a7fffbb70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==postgres==104001==ABORTING
Closing because we're not seeing this issue anymore.
What type of bug is this?
Crash
What subsystems and features are affected?
Compression
What happened?
CI produces specific core dumps consistently when running with ASAN for PG13 and PG14.
e.g. https://github.com/timescale/timescaledb/actions/runs/3308403799/jobs/5460759336
TimescaleDB version affected
2.9.0-dev
PostgreSQL version used
14.5
What operating system did you use?
Ubuntu 20.04 x64
What installation method did you use?
Other
What platform did you run on?
Other
Relevant log output and stack trace
How can we reproduce the bug?