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

[YSQL] SEGV on unknown address inyb::PgsqlReadRequestPB::~PgsqlReadRequestPB() #11264

Open
def- opened this issue Jan 27, 2022 · 4 comments
Open
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@def-
Copy link
Contributor

def- commented Jan 27, 2022

Jira Link: DB-962

Description

Similar one to #11260, not sure if related:

TRAP: FailedAssertion("!(bms_is_subset(appendrel->lateral_relids, required_outer))", File: "../../../../../../../src/postgres/src/backend/optimizer/util/relnode.c", Line: 1543)
2022-01-27 19:26:47.541 UTC [14221] LOG:  server process (PID 15894) was terminated by signal 6: Aborted
2022-01-27 19:26:47.541 UTC [14221] DETAIL:  Failed process was running: select
	  pg_catalog.pg_wal_replay_resume() as c0,
	  subq_8.c2 as c1,
	  subq_2.c0 as c2,
	  subq_8.c3 as c3,
	  cast(coalesce(subq_7.c2,
	    pg_catalog.pg_relation_filenode(
	      cast(pg_catalog.to_regclass(
	        cast((select adsrc from pg_catalog.pg_attrdef limit 1 offset 8)
	           as text)) as regclass))) as oid) as c4,
	  subq_8.c6 as c5,
	  subq_2.c0 as c6,
	  pg_catalog.regclass(
	    cast(pg_catalog.current_query() as text)) as c7,
	  (select relname from pg_catalog.pg_stat_all_indexes limit 1 offset 1)
	     as c8,
	  subq_7.c3 as c9,
	  subq_2.c1 as c10,
	  subq_2.c0 as c11
	from
	  (select
	        subq_1.c3 as c0,
	        (select data_type from information_schema.sequences limit 1 offset 6)
	           as c1
	      from
	        (select
	              ref_0.utc_offset as c0,
	              ref_0.abbrev as c1,
	              ref_0.abbrev as c2,
	              subq_0.c9 as c3,
	              subq_0.c8 as c4
	            from
	              pg_catalog.pg_timezone_abbrevs as ref_0,

2022-01-27 19:26:47.541 UTC [14221] LOG:  terminating any other active server processes
2022-01-27 19:26:47.541 UTC [15893] WARNING:  terminating connection because of crash of another server process
2022-01-27 19:26:47.541 UTC [15893] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2022-01-27 19:26:47.541 UTC [15893] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-27 19:26:47.541 UTC [15891] WARNING:  terminating connection because of crash of another server process
2022-01-27 19:26:47.541 UTC [15891] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2022-01-27 19:26:47.541 UTC [15891] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-27 19:26:47.541 UTC [15889] WARNING:  terminating connection because of crash of another server process
2022-01-27 19:26:47.541 UTC [15889] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2022-01-27 19:26:47.541 UTC [15889] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-27 19:26:47.541 UTC [15890] WARNING:  terminating connection because of crash of another server process
2022-01-27 19:26:47.541 UTC [15890] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2022-01-27 19:26:47.541 UTC [15890] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-27 19:26:47.542 UTC [15892] WARNING:  terminating connection because of crash of another server process
2022-01-27 19:26:47.542 UTC [15892] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2022-01-27 19:26:47.542 UTC [15892] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-27 19:26:47.542 UTC [15887] WARNING:  terminating connection because of crash of another server process
2022-01-27 19:26:47.542 UTC [15887] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2022-01-27 19:26:47.542 UTC [15887] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-27 19:26:47.542 UTC [15885] WARNING:  terminating connection because of crash of another server process
2022-01-27 19:26:47.542 UTC [15885] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2022-01-27 19:26:47.542 UTC [15885] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-27 19:26:47.542 UTC [15888] WARNING:  terminating connection because of crash of another server process
2022-01-27 19:26:47.542 UTC [15888] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2022-01-27 19:26:47.542 UTC [15888] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
I0127 19:26:47.545903 15896 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 108)
I0127 19:26:47.548909 15909 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 108)
I0127 19:26:47.551622 15928 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 108)
I0127 19:26:47.552982 15912 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 108)
I0127 19:26:47.554090 15918 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 108)
I0127 19:26:47.556972 15944 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 108)
I0127 19:26:47.560587 15946 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 108)
I0127 19:26:47.563747 15931 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 108)
AddressSanitizer:DEADLYSIGNAL
=================================================================
==15893==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x7f1f49e6af7d bp 0x7ffc77804940 sp 0x7ffc77804940 T0)
==15893==The signal is caused by a READ memory access.
==15893==Hint: this fault was caused by a dereference of a high value address (see register values below).  Disassemble the provided pc to learn which register was used.
    #0 0x7f1f49e6af7d in google::protobuf::internal::GenericTypeHandler<yb::PgsqlExpressionPB>::Delete(yb::PgsqlExpressionPB*, google::protobuf::Arena*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/include/google/protobuf/repeated_field.h:623:7
    #1 0x7f1f49e6aebb in void google::protobuf::internal::RepeatedPtrFieldBase::Destroy<google::protobuf::RepeatedPtrField<yb::PgsqlExpressionPB>::TypeHandler>() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/include/google/protobuf/repeated_field.h:1473:7
    #2 0x7f1f49e4f26e in google::protobuf::RepeatedPtrField<yb::PgsqlExpressionPB>::~RepeatedPtrField() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/include/google/protobuf/repeated_field.h:1934:3
    #3 0x7f1f3c57f8ca in yb::PgsqlReadRequestPB::~PgsqlReadRequestPB() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/src/yb/common/pgsql_protocol.pb.cc:6552:1
    #4 0x7f1f3c57fdfd in yb::PgsqlReadRequestPB::~PgsqlReadRequestPB() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/src/yb/common/pgsql_protocol.pb.cc:6549:43
    #5 0x7f1f44fc8514 in std::__1::default_delete<yb::PgsqlReadRequestPB>::operator()(yb::PgsqlReadRequestPB*) const /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:1423:5
    #6 0x7f1f44fc849a in std::__1::unique_ptr<yb::PgsqlReadRequestPB, std::__1::default_delete<yb::PgsqlReadRequestPB> >::reset(yb::PgsqlReadRequestPB*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:1684:7
    #7 0x7f1f44fc843a in std::__1::unique_ptr<yb::PgsqlReadRequestPB, std::__1::default_delete<yb::PgsqlReadRequestPB> >::~unique_ptr() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:1638:19
    #8 0x7f1f44fc225f in yb::client::YBPgsqlReadOp::~YBPgsqlReadOp() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/client/yb_op.h:515:7
    #9 0x7f1f44fc228d in yb::client::YBPgsqlReadOp::~YBPgsqlReadOp() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/client/yb_op.h:515:7
    #10 0x7f1f49e5cf54 in std::__1::default_delete<yb::client::YBPgsqlReadOp>::operator()(yb::client::YBPgsqlReadOp*) const /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:1423:5
    #11 0x7f1f49ecbe4b in std::__1::__shared_ptr_pointer<yb::client::YBPgsqlReadOp*, std::__1::default_delete<yb::client::YBPgsqlReadOp>, std::__1::allocator<yb::client::YBPgsqlReadOp> >::__on_zero_shared() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:2591:5
    #12 0x7f1f49e1cce7 in std::__1::__shared_count::__release_shared() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:2501:9
    #13 0x7f1f49e1cc7d in std::__1::__shared_weak_count::__release_shared() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:2543:27
    #14 0x7f1f49eb6594 in std::__1::shared_ptr<yb::client::YBPgsqlReadOp>::~shared_ptr() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:3233:19
    #15 0x7f1f49f321ae in yb::pggate::PgDocReadOp::~PgDocReadOp() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_doc_op.h:399:7
    #16 0x7f1f49e59225 in std::__1::__shared_ptr_emplace<yb::pggate::PgDocReadOp, std::__1::allocator<yb::pggate::PgDocReadOp> >::__on_zero_shared() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:2639:24
    #17 0x7f1f49e1cce7 in std::__1::__shared_count::__release_shared() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:2501:9
    #18 0x7f1f49e1cc7d in std::__1::__shared_weak_count::__release_shared() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:2543:27
    #19 0x7f1f49e598f4 in std::__1::shared_ptr<yb::pggate::PgDocOp>::~shared_ptr() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:3233:19
    #20 0x7f1f49edfb3e in yb::pggate::PgDml::~PgDml() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_dml.cc:63:1
    #21 0x7f1f49ef8ad8 in yb::pggate::PgDmlRead::~PgDmlRead() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_dml_read.cc:80:1
    #22 0x7f1f49f09d48 in yb::pggate::PgSelect::~PgSelect() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_select.cc:37:1
    #23 0x7f1f49f09d5d in yb::pggate::PgSelect::~PgSelect() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_select.cc:36:23
    #24 0x7f1f49f6db14 in std::__1::default_delete<yb::pggate::PgMemctx::Registrable>::operator()(yb::pggate::PgMemctx::Registrable*) const /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:1423:5
    #25 0x7f1f49f669b8 in void boost::intrusive::list_impl<boost::intrusive::bhtraits<yb::pggate::PgMemctx::Registrable, boost::intrusive::list_node_traits<void*>, (boost::intrusive::link_mode_type)1, boost::intrusive::dft_tag, 1u>, unsigned long, true, void>::clear_and_dispose<std::__1::default_delete<yb::pggate::PgMemctx::Registrable> >(std::__1::default_delete<yb::pggate::PgMemctx::Registrable>) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/include/boost/intrusive/list.hpp:754:10
    #26 0x7f1f49f64ded in yb::pggate::PgMemctx::Clear() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_memctx.cc:80:23
    #27 0x7f1f49f64d7f in yb::pggate::PgMemctx::~PgMemctx() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_memctx.cc:29:3
    #28 0x7f1f49f69db5 in std::__1::__shared_ptr_emplace<yb::pggate::PgMemctx, std::__1::allocator<yb::pggate::PgMemctx> >::__on_zero_shared() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:2639:24
    #29 0x7f1f49e1cce7 in std::__1::__shared_count::__release_shared() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:2501:9
    #30 0x7f1f49e1cc7d in std::__1::__shared_weak_count::__release_shared() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:2543:27
    #31 0x7f1f49f66074 in std::__1::shared_ptr<yb::pggate::PgMemctx>::~shared_ptr() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/memory:3233:19
    #32 0x7f1f49f694bc in std::__1::pair<yb::pggate::PgMemctx* const, std::__1::shared_ptr<yb::pggate::PgMemctx> >::~pair() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/utility:297:29
    #33 0x7f1f49f693f8 in void std::__1::allocator_traits<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<yb::pggate::PgMemctx*, std::__1::shared_ptr<yb::pggate::PgMemctx> >, void*> > >::destroy<std::__1::pair<yb::pggate::PgMemctx* const, std::__1::shared_ptr<yb::pggate::PgMemctx> >, void, void>(std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<yb::pggate::PgMemctx*, std::__1::shared_ptr<yb::pggate::PgMemctx> >, void*> >&, std::__1::pair<yb::pggate::PgMemctx* const, std::__1::shared_ptr<yb::pggate::PgMemctx> >*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/__memory/allocator_traits.h:317:15
    #34 0x7f1f49f69359 in std::__1::__hash_table<std::__1::__hash_value_type<yb::pggate::PgMemctx*, std::__1::shared_ptr<yb::pggate::PgMemctx> >, std::__1::__unordered_map_hasher<yb::pggate::PgMemctx*, std::__1::__hash_value_type<yb::pggate::PgMemctx*, std::__1::shared_ptr<yb::pggate::PgMemctx> >, std::__1::hash<yb::pggate::PgMemctx*>, std::__1::equal_to<yb::pggate::PgMemctx*>, true>, std::__1::__unordered_map_equal<yb::pggate::PgMemctx*, std::__1::__hash_value_type<yb::pggate::PgMemctx*, std::__1::shared_ptr<yb::pggate::PgMemctx> >, std::__1::equal_to<yb::pggate::PgMemctx*>, std::__1::hash<yb::pggate::PgMemctx*>, true>, std::__1::allocator<std::__1::__hash_value_type<yb::pggate::PgMemctx*, std::__1::shared_ptr<yb::pggate::PgMemctx> > > >::__deallocate_node(std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<yb::pggate::PgMemctx*, std::__1::shared_ptr<yb::pggate::PgMemctx> >, void*>*>*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/__hash_table:1580:9
    #35 0x7f1f49f7080a in std::__1::__hash_table<std::__1::__hash_value_type<yb::pggate::PgMemctx*, std::__1::shared_ptr<yb::pggate::PgMemctx> >, std::__1::__unordered_map_hasher<yb::pggate::PgMemctx*, std::__1::__hash_value_type<yb::pggate::PgMemctx*, std::__1::shared_ptr<yb::pggate::PgMemctx> >, std::__1::hash<yb::pggate::PgMemctx*>, std::__1::equal_to<yb::pggate::PgMemctx*>, true>, std::__1::__unordered_map_equal<yb::pggate::PgMemctx*, std::__1::__hash_value_type<yb::pggate::PgMemctx*, std::__1::shared_ptr<yb::pggate::PgMemctx> >, std::__1::equal_to<yb::pggate::PgMemctx*>, std::__1::hash<yb::pggate::PgMemctx*>, true>, std::__1::allocator<std::__1::__hash_value_type<yb::pggate::PgMemctx*, std::__1::shared_ptr<yb::pggate::PgMemctx> > > >::clear() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/__hash_table:1826:9
    #36 0x7f1f49f66ed8 in std::__1::unordered_map<yb::pggate::PgMemctx*, std::__1::shared_ptr<yb::pggate::PgMemctx>, std::__1::hash<yb::pggate::PgMemctx*>, std::__1::equal_to<yb::pggate::PgMemctx*>, std::__1::allocator<std::__1::pair<yb::pggate::PgMemctx* const, std::__1::shared_ptr<yb::pggate::PgMemctx> > > >::clear() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/libcxx/include/c++/v1/unordered_map:1274:42
    #37 0x7f1f49f65b47 in yb::pggate::ClearGlobalPgMemctxMap() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_memctx.cc:99:28
    #38 0x7f1f49dfbb99 in YBCDestroyPgGate /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/ybc_pggate.cc:133:5
    #39 0x1437bca in YBOnPostgresBackendShutdown /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/utils/misc/../../../../../../../src/postgres/src/backend/utils/misc/pg_yb_utils.c:513:2
    #40 0xfe7712 in quickdie /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/tcop/../../../../../../src/postgres/src/backend/tcop/postgres.c:2683:3
    #41 0x7f1f48bbe62f  (/lib64/libpthread.so.0+0xf62f)
    #42 0x7f1f4d54b6ef in __asan::Allocator::Allocate(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*, __asan::AllocType, bool) /opt/yb-build/llvm/yb-llvm-v12.0.1-yb-1-1633099823-bdb147e6-centos7-x86_64-build/src/llvm-project/compiler-rt/lib/asan/asan_allocator.cpp:568:19
    #43 0x7f1f4d54bf99 in __asan::asan_memalign(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*, __asan::AllocType) /opt/yb-build/llvm/yb-llvm-v12.0.1-yb-1-1633099823-bdb147e6-centos7-x86_64-build/src/llvm-project/compiler-rt/lib/asan/asan_allocator.cpp:1040:16
    #44 0x7f1f4d5d0db2 in operator new(unsigned long) /opt/yb-build/llvm/yb-llvm-v12.0.1-yb-1-1633099823-bdb147e6-centos7-x86_64-build/src/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99:3
    #45 0x7f1f49e5d683 in yb::PgsqlExpressionPB* google::protobuf::Arena::Create<yb::PgsqlExpressionPB>(google::protobuf::Arena*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/include/google/protobuf/arena.h:361:14
    #46 0x7f1f49e5d683 in yb::PgsqlExpressionPB* google::protobuf::Arena::CreateMaybeMessage<yb::PgsqlExpressionPB>(google::protobuf::Arena*, google::protobuf::internal::integral_constant<bool, false>) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/include/google/protobuf/arena.h:676:12
    #47 0x7f1f49e5d683 in yb::PgsqlExpressionPB* google::protobuf::Arena::CreateMaybeMessage<yb::PgsqlExpressionPB>(google::protobuf::Arena*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/include/google/protobuf/arena.h:681:12
    #48 0x7f1f49e5d683 in google::protobuf::internal::GenericTypeHandler<yb::PgsqlExpressionPB>::New(google::protobuf::Arena*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/include/google/protobuf/repeated_field.h:617:12
    #49 0x7f1f49e5d613 in google::protobuf::internal::GenericTypeHandler<yb::PgsqlExpressionPB>::NewFromPrototype(yb::PgsqlExpressionPB const*, google::protobuf::Arena*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/include/google/protobuf/repeated_field.h:647:10
    #50 0x7f1f49e5d385 in google::protobuf::RepeatedPtrField<yb::PgsqlExpressionPB>::TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add<google::protobuf::RepeatedPtrField<yb::PgsqlExpressionPB>::TypeHandler>(google::protobuf::RepeatedPtrField<yb::PgsqlExpressionPB>::TypeHandler::Type*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/include/google/protobuf/repeated_field.h:1553:7
    #51 0x7f1f49e4ec1a in google::protobuf::RepeatedPtrField<yb::PgsqlExpressionPB>::Add() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/include/google/protobuf/repeated_field.h:2000:32
    #52 0x7f1f49e57b2c in yb::PgsqlReadRequestPB::add_targets() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/src/yb/common/pgsql_protocol.pb.h:5755:19
    #53 0x7f1f49ef8f6a in yb::pggate::PgDmlRead::AllocTargetPB() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_dml_read.cc:119:21
    #54 0x7f1f49edffee in yb::pggate::PgDml::AppendTargetPB(yb::pggate::PgExpr*) /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_dml.cc:84:32
    #55 0x7f1f49edfd4c in yb::pggate::PgDml::AppendTarget(yb::pggate::PgExpr*) /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_dml.cc:70:5
    #56 0x7f1f49e3b957 in yb::pggate::PgApiImpl::DmlAppendTarget(yb::pggate::PgStatement*, yb::pggate::PgExpr*) /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pggate.cc:890:37
    #57 0x7f1f49e022fc in YBCPgDmlAppendTarget /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/ybc_pggate.cc:574:29
    #58 0x744e42 in ybcAddTargetColumn /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/access/yb_access/../../../../../../../src/postgres/src/backend/access/yb_access/yb_scan.c:260:17
    #59 0x744b2e in ybcAddTargetColumnIfRequired /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/access/yb_access/../../../../../../../src/postgres/src/backend/access/yb_access/yb_scan.c:1135:3
    #60 0x73c2e9 in ybcSetupTargets /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/access/yb_access/../../../../../../../src/postgres/src/backend/access/yb_access/yb_scan.c:1155:4
    #61 0x737a95 in ybcBeginScan /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/access/yb_access/../../../../../../../src/postgres/src/backend/access/yb_access/yb_scan.c:1232:2
    #62 0x73f1a7 in ybc_systable_beginscan /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/access/yb_access/../../../../../../../src/postgres/src/backend/access/yb_access/yb_scan.c:1476:22
    #63 0x60a2e7 in systable_beginscan /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/access/index/../../../../../../../src/postgres/src/backend/access/index/genam.c:345:10
    #64 0x135b1ef in SearchCatCacheMiss /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/utils/cache/../../../../../../../src/postgres/src/backend/utils/cache/catcache.c:1764:13
    #65 0x1356e2c in SearchCatCacheInternal /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/utils/cache/../../../../../../../src/postgres/src/backend/utils/cache/catcache.c:1665:9
    #66 0x1357148 in SearchCatCache1 /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/utils/cache/../../../../../../../src/postgres/src/backend/utils/cache/catcache.c:1533:9
    #67 0x13abed2 in SearchSysCache1 /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/utils/cache/../../../../../../../src/postgres/src/backend/utils/cache/syscache.c:1615:9
    #68 0x1366543 in func_parallel /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/utils/cache/../../../../../../../src/postgres/src/backend/utils/cache/lsyscache.c:1596:7
    #69 0xd9ee1d in max_parallel_hazard_checker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1161:34
    #70 0xc27d16 in check_functions_in_node /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c
    #71 0xd9439b in max_parallel_hazard_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1172:6
    #72 0xc28bd4 in expression_tree_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c
    #73 0xd9460a in max_parallel_hazard_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1306:9
    #74 0xc28381 in expression_tree_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c:2123:9
    #75 0xd9460a in max_parallel_hazard_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1306:9
    #76 0xc29d16 in query_tree_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c:2668:6
    #77 0xd94645 in max_parallel_hazard_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1300:10
    #78 0xc2a0da in range_table_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c
    #79 0xc29ee0 in query_tree_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c:2693:7
    #80 0xd94645 in max_parallel_hazard_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1300:10
    #81 0xc28bd4 in expression_tree_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c
    #82 0xd9460a in max_parallel_hazard_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1306:9
    #83 0xc28302 in expression_tree_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c:2047:10
    #84 0xd9460a in max_parallel_hazard_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1306:9
    #85 0xc28381 in expression_tree_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c:2123:9
    #86 0xc28a84 in expression_tree_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c
    #87 0xd9460a in max_parallel_hazard_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1306:9
    #88 0xc28ba7 in expression_tree_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c
    #89 0xd9460a in max_parallel_hazard_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1306:9
    #90 0xc29dc8 in query_tree_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c:2676:6
    #91 0xd94645 in max_parallel_hazard_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1300:10
    #92 0xc2a0da in range_table_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c
    #93 0xc29ee0 in query_tree_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/nodes/../../../../../../src/postgres/src/backend/nodes/nodeFuncs.c:2693:7
    #94 0xd94645 in max_parallel_hazard_walker /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1300:10
    #95 0xd942c0 in max_parallel_hazard /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/util/../../../../../../../src/postgres/src/backend/optimizer/util/clauses.c:1076:9
    #96 0xd4b753 in standard_planner /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/plan/../../../../../../../src/postgres/src/backend/optimizer/plan/planner.c:346:29
    #97 0x7f1f2dd04218 in pg_hint_plan_planner /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/third-party-extensions/pg_hint_plan/../../../../../src/postgres/third-party-extensions/pg_hint_plan/pg_hint_plan.c:3221:12
    #98 0xd4a3c4 in planner /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/optimizer/plan/../../../../../../../src/postgres/src/backend/optimizer/plan/planner.c:261:12
    #99 0xfe6ad6 in pg_plan_query /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/tcop/../../../../../../src/postgres/src/backend/tcop/postgres.c:848:9
    #100 0xfe6e8d in pg_plan_queries /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/tcop/../../../../../../src/postgres/src/backend/tcop/postgres.c:914:11
    #101 0xff53df in exec_simple_query /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/tcop/../../../../../../src/postgres/src/backend/tcop/postgres.c:1089:19
    #102 0xff31e8 in yb_exec_simple_query_impl /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/tcop/../../../../../../src/postgres/src/backend/tcop/postgres.c:4464:2
    #103 0xff30a2 in yb_exec_query_wrapper /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/tcop/../../../../../../src/postgres/src/backend/tcop/postgres.c:4445:4
    #104 0xfed2a1 in yb_exec_simple_query /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/tcop/../../../../../../src/postgres/src/backend/tcop/postgres.c:4479:2
    #105 0xfeb552 in PostgresMain /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/tcop/../../../../../../src/postgres/src/backend/tcop/postgres.c:5087:23
    #106 0xe38a7c in BackendRun /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/postmaster/../../../../../../src/postgres/src/backend/postmaster/postmaster.c:4470:2
    #107 0xe37885 in BackendStartup /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/postmaster/../../../../../../src/postgres/src/backend/postmaster/postmaster.c:4136:3
    #108 0xe35645 in ServerLoop /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/postmaster/../../../../../../src/postgres/src/backend/postmaster/postmaster.c:1754:7
    #109 0xe31c4a in PostmasterMain /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/postmaster/../../../../../../src/postgres/src/backend/postmaster/postmaster.c:1417:11
    #110 0xc224a9 in PostgresServerProcessMain /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/main/../../../../../../src/postgres/src/backend/main/main.c:234:3
    #111 0xc22bb1 in main (/nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/postgres/bin/postgres+0xc22bb1)
    #112 0x7f1f48803554 in __libc_start_main (/lib64/libc.so.6+0x22554)
    #113 0x488738 in _start (/nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/postgres/bin/postgres+0x488738)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20211222064215-dd4872fe56-centos7-x86_64-clang12/installed/asan/include/google/protobuf/repeated_field.h:623:7 in google::protobuf::internal::GenericTypeHandler<yb::PgsqlExpressionPB>::Delete(yb::PgsqlExpressionPB*, google::protobuf::Arena*)
==15893==ABORTING
@def- def- added the area/ysql Yugabyte SQL (YSQL) label Jan 27, 2022
@tedyu
Copy link
Contributor

tedyu commented Jan 27, 2022

The query seems to be incomplete:

	            from
	              pg_catalog.pg_timezone_abbrevs as ref_0,

Can you post the complete query ?

@def-
Copy link
Contributor Author

def- commented Jan 27, 2022

CREATE TABLE mvtest_t (id int NOT NULL PRIMARY KEY, type text NOT NULL, amt numeric NOT NULL);
INSERT INTO mvtest_t VALUES
  (1, 'x', 2),
  (2, 'x', 3),
  (3, 'y', 5),
  (4, 'y', 7),
  (5, 'z', 11);
CREATE VIEW mvtest_tv AS SELECT type, sum(amt) AS totamt FROM mvtest_t GROUP BY type;
CREATE MATERIALIZED VIEW mvtest_tvm AS SELECT * FROM mvtest_tv ORDER BY type;

CREATE TABLE mvtest_boxes (id serial primary key, b box);
INSERT INTO mvtest_boxes (b) VALUES
  ('(32,32),(31,31)'),
  ('(2.0000004,2.0000004),(1,1)'),
  ('(1.9999996,1.9999996),(1,1)');
CREATE MATERIALIZED VIEW mvtest_boxmv AS SELECT * FROM mvtest_boxes;

select  
  pg_catalog.pg_wal_replay_resume() as c0, 
  subq_8.c2 as c1, 
  subq_2.c0 as c2, 
  subq_8.c3 as c3, 
  cast(coalesce(subq_7.c2,
    pg_catalog.pg_relation_filenode(
      cast(pg_catalog.to_regclass(
        cast((select adsrc from pg_catalog.pg_attrdef limit 1 offset 8)
           as text)) as regclass))) as oid) as c4, 
  subq_8.c6 as c5, 
  subq_2.c0 as c6, 
  pg_catalog.regclass(
    cast(pg_catalog.current_query() as text)) as c7, 
  (select relname from pg_catalog.pg_stat_all_indexes limit 1 offset 1)
     as c8, 
  subq_7.c3 as c9, 
  subq_2.c1 as c10, 
  subq_2.c0 as c11
from 
  (select  
        subq_1.c3 as c0, 
        (select data_type from information_schema.sequences limit 1 offset 6)
           as c1
      from 
        (select  
              ref_0.utc_offset as c0, 
              ref_0.abbrev as c1, 
              ref_0.abbrev as c2, 
              subq_0.c9 as c3, 
              subq_0.c8 as c4
            from 
              pg_catalog.pg_timezone_abbrevs as ref_0,
              lateral (select  
                    ref_1.lanispl as c0, 
                    ref_0.utc_offset as c1, 
                    ref_0.utc_offset as c2, 
                    ref_1.lanowner as c3, 
                    ref_1.lanpltrusted as c4, 
                    50 as c5, 
                    ref_1.lanispl as c6, 
                    ref_1.lanispl as c7, 
                    ref_1.lanacl as c8, 
                    ref_0.is_dst as c9, 
                    ref_1.lanowner as c10
                  from 
                    pg_catalog.pg_language as ref_1
                  where ref_0.utc_offset is NULL
                  limit 107) as subq_0
            where (select b from public.mvtest_boxmv limit 1 offset 4)
                 @> cast(null as point)) as subq_1
      where (false) 
        or (subq_1.c1 is NULL)
      limit 107) as subq_2,
  lateral (select  
        ref_2.datdba as c0, 
        ref_3.setrole as c1
      from 
        pg_catalog.pg_database as ref_2
          inner join pg_catalog.pg_db_role_setting as ref_3
          on (subq_2.c1 is not NULL)
      where 12 is not NULL
      limit 47) as subq_3,
  lateral (select  
        subq_2.c1 as c0, 
        ref_4.provariadic as c1, 
        subq_2.c0 as c2, 
        
          pg_catalog.corr(
            cast((select total_time from pg_catalog.pg_stat_xact_user_functions limit 1 offset 3)
               as float8),
            cast((select total_time from pg_catalog.pg_stat_xact_user_functions limit 1 offset 70)
               as float8)) over (partition by subq_3.c1 order by subq_2.c1,subq_2.c1) as c3, 
        subq_3.c1 as c4
      from 
        pg_catalog.pg_proc as ref_4,
        lateral (select  
              ref_4.prolang as c0
            from 
              information_schema.sql_features as ref_5
            where subq_3.c1 >= subq_3.c0
            limit 80) as subq_4
      where pg_catalog.random() = pg_catalog.pg_stat_get_checkpoint_write_time()) as subq_5,
  lateral (select  
        case when cast(null as int8) <> (select blks_read from pg_catalog.pg_statio_all_sequences limit 1 offset 6)
               then ref_7.srvname else ref_7.srvname end
           as c0, 
        pg_catalog.session_user() as c1, 
        subq_5.c4 as c2, 
        subq_6.c0 as c3
      from 
        pg_catalog.pg_namespace as ref_6
            right join pg_catalog.pg_foreign_server as ref_7
            on ((cast(null as anyrange) &> cast(null as anyrange)) 
                or ((true) 
                  and (cast(null as date) = cast(null as "timestamp"))))
          left join information_schema.administrable_role_authorizations as ref_8
          on ((true) 
              or (((subq_5.c2 is NULL) 
                  or (ref_8.grantee is not NULL)) 
                or (ref_6.nspowner is not NULL))),
        lateral (select  
              subq_3.c0 as c0, 
              ref_6.nspowner as c1, 
              subq_5.c0 as c2
            from 
              public.mvtest_tvm as ref_9
            where cast(null as bpchar) ~<=~ cast(null as bpchar)
            limit 104) as subq_6
      where case when (true) 
            and (false) then cast(null as int2) else cast(null as int2) end
           <= case when true then cast(nullif((select archived_count from pg_catalog.pg_stat_archiver limit 1 offset 1)
              ,
            (select seq_scan from pg_catalog.pg_stat_xact_user_tables limit 1 offset 4)
              ) as int8) else cast(nullif((select archived_count from pg_catalog.pg_stat_archiver limit 1 offset 1)
              ,
            (select seq_scan from pg_catalog.pg_stat_xact_user_tables limit 1 offset 4)
              ) as int8) end
          ) as subq_7,
  lateral (select  
        ref_10.trflang as c0, 
        ref_10.trftosql as c1, 
        28 as c2, 
        (select last_failed_time from pg_catalog.pg_stat_archiver limit 1 offset 9)
           as c3, 
        (select pg_catalog.every(condefault) from pg_catalog.pg_conversion)
           as c4, 
        ref_10.trflang as c5, 
        subq_7.c3 as c6
      from 
        pg_catalog.pg_transform as ref_10
      where cast(null as line) ?# cast(null as box)) as subq_8
where pg_catalog.float4(
    cast(pg_catalog.jsonb_delete(
      cast((select pg_catalog.jsonb_agg(foreign_table_catalog) from information_schema.foreign_table_options)
         as jsonb),
      cast(cast(null as text) as text)) as jsonb)) > subq_5.c3
limit 54;
Error: ERROR:  canceling statement due to statement timeout

This might be due to the query being cancelled and getting the timing right. Can't reproduce.

@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Jun 8, 2022
@sushantrmishra
Copy link

This issue is still reproducible in 2.19.3 (Master).

#0  0x00007f8433b22387 in raise () from /lib64/libc.so.6
#1  0x00007f8433b23a78 in abort () from /lib64/libc.so.6
#2  0x000055bde163323d in ExceptionalCondition (
    conditionName=0x55bde0c35242 "!(bms_is_subset(appendrel->lateral_relids, required_outer))",
    errorType=0x55bde0b9c80d "FailedAssertion",
    fileName=0x55bde0bc85d6 "../../../../../../../src/postgres/src/backend/optimizer/util/relnode.c",
    lineNumber=1690) at ../../../../../../../src/postgres/src/backend/utils/error/assert.c:54
#3  0x000055bde132c808 in get_appendrel_parampathinfo (appendrel=0x355dbecd46f0, required_outer=0x0)
    at ../../../../../../../src/postgres/src/backend/optimizer/util/relnode.c:1690
#4  0x000055bde131b24a in create_append_path (root=0x0, rel=0x355dbecd46f0, subpaths=0x0,
    partial_subpaths=0x0, required_outer=0x0, parallel_workers=0, parallel_aware=false, partitioned_rels=0x0,
    rows=-1) at ../../../../../../../src/postgres/src/backend/optimizer/util/pathnode.c:1456
#5  0x000055bde12ac819 in set_dummy_rel_pathlist (rel=0x355dbecd46f0)
    at ../../../../../../../src/postgres/src/backend/optimizer/path/allpaths.c:2118
#6  0x000055bde12ae8bc in set_subquery_pathlist (root=0x22a3ffe13dc0, rel=0x355dbecd46f0, rti=4,
    rte=0x22a3ffe25c98) at ../../../../../../../src/postgres/src/backend/optimizer/path/allpaths.c:2304
#7  0x000055bde12ad68d in set_rel_size (root=0x22a3ffe13dc0, rel=0x355dbecd46f0, rti=4, rte=0x22a3ffe25c98)
    at ../../../../../../../src/postgres/src/backend/optimizer/path/allpaths.c:446
#8  0x000055bde12ab1cc in set_base_rel_sizes (root=0x22a3ffe13dc0)
    at ../../../../../../../src/postgres/src/backend/optimizer/path/allpaths.c:331
#9  0x000055bde12aaf38 in make_one_rel (root=0x22a3ffe13dc0, joinlist=0x355dbecd6230)
    at ../../../../../../../src/postgres/src/backend/optimizer/path/allpaths.c:229
#10 0x000055bde12ea4f0 in query_planner (root=0x22a3ffe13dc0, tlist=0x355dbec835c8,
    qp_callback=0x55bde12f0a90 <standard_qp_callback>, qp_extra=0x7ffe2fdfe398)
        at ../../../../../../../src/postgres/src/backend/optimizer/plan/planmain.c:265
#11 0x000055bde12ee094 in grouping_planner (root=0x22a3ffe13dc0, inheritance_update=false, tuple_fraction=0)
    at ../../../../../../../src/postgres/src/backend/optimizer/plan/planner.c:2096
#12 0x000055bde12ebce3 in subquery_planner (glob=0x355dbf2ed078, parse=0x22a3ffe05cf8, parent_root=0x0,
    hasRecursion=false, tuple_fraction=0)
    at ../../../../../../../src/postgres/src/backend/optimizer/plan/planner.c:981
#13 0x000055bde12ea8d4 in standard_planner (parse=0x22a3ffe05cf8, cursorOptions=256, boundParams=0x0)
    at ../../../../../../../src/postgres/src/backend/optimizer/plan/planner.c:410
#14 0x00007f842604b21e in pg_hint_plan_planner (parse=0x22a3ffe05cf8, cursorOptions=256, boundParams=0x0)
    at ../../../../../src/postgres/third-party-extensions/pg_hint_plan/pg_hint_plan.c:3227
#15 0x000055bde12ea61b in planner (parse=0x22a3ffe05cf8, cursorOptions=256, boundParams=0x0)
    at ../../../../../../../src/postgres/src/backend/optimizer/plan/planner.c:266
#16 0x000055bde1434229 in pg_plan_query (querytree=0x22a3ffe05cf8, cursorOptions=256, boundParams=0x0)
    at ../../../../../../src/postgres/src/backend/tcop/postgres.c:902
#17 0x000055bde143437f in pg_plan_queries (querytrees=0x355dbf2e5cf8, cursorOptions=256, boundParams=0x0)
    at ../../../../../../src/postgres/src/backend/tcop/postgres.c:968
#18 0x000055bde143ee1e in exec_simple_query (
    query_string=0x355dbf8e6040 "select  \n  pg_catalog.pg_wal_replay_resume() as c0, \n  subq_8.c2 as c1, \n  subq_2.c0 as c2, \n  subq_8.c3 as c3, \n  cast(coalesce(subq_7.c2,\n    pg_catalog.pg_relation_filenode(\n      cast(pg_catalog.t"...) at ../../../../../../src/postgres/src/backend/tcop/postgres.c:1145
#19 0x000055bde143c9e5 in yb_exec_simple_query_impl (query_string=0x355dbf8e6040)
    at ../../../../../../src/postgres/src/backend/tcop/postgres.c:4753
#20 0x000055bde143cb0f in yb_exec_query_wrapper_one_attempt (exec_context=0x355dbfd1c000,
    restart_data=0x7ffe2fdfebb8, functor=0x55bde143c9d0 <yb_exec_simple_query_impl>,

@yugabyte-ci yugabyte-ci added priority/high High Priority and removed priority/medium Medium priority issue labels Oct 27, 2023
@yugabyte-ci yugabyte-ci added priority/medium Medium priority issue and removed priority/high High Priority labels Aug 19, 2024
@sushantrmishra
Copy link

Not able to reproduce in 2.23-b684.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

4 participants