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][SQLsmith] AddressSanitizer: SEGV on unknown address 0x000000000408 in yb::PgsqlResponsePB::SharedCtor() #11260

Open
def- opened this issue Jan 27, 2022 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug kind/failing-test Tests and testing infra priority/medium Medium priority issue qa_automation Bugs identified via itest-system, LST, Stress automation or causing automation failures

Comments

@def-
Copy link
Contributor

def- commented Jan 27, 2022

Jira Link: DB-760

Description

SQLsmith with asan found this. Very similar to #11259 Also can't reproduce, but this indicates some very wrong pointer address:

TRAP: FailedAssertion("!(bms_is_subset(appendrel->lateral_relids, required_outer))", File: "../../../../../../../src/postgres/src/backend/optimizer/util/relnode.c", Line: 1543)
2022-01-27 12:56:22.971 UTC [14009] LOG:  server process (PID 24492) was terminated by signal 6: Aborted
2022-01-27 12:56:22.971 UTC [14009] DETAIL:  Failed process was running: select  
	  subq_0.c3 as c0, 
	  subq_0.c0 as c1, 
	  subq_1.c0 as c2
	from 
	  (select  
	        ref_0.col as c0, 
	        ref_0.col as c1, 
	        ref_0.col as c2, 
	        ref_0.col as c3, 
	        ref_0.col as c4, 
	        ref_0.col as c5, 
	        ref_0.col as c6, 
	        (select privilege_type from information_schema.role_column_grants limit 1 offset 19)
	           as c7
	      from 
	        public.pg_temp__123 as ref_0
	      where (select last_vacuum from pg_catalog.pg_stat_user_tables limit 1 offset 2)
	           = cast(null as "timestamp")
	      limit 107) as subq_0,
	  lateral (select  
	        ref_4.cmd as c0, 
	        ref_4.tablename as c1, 
	        (select pg_catalog.var_samp(checkpoint_write_time) from pg_catalog.pg_stat_bgwriter)
	           as c2, 
	        ref_2.initprivs as c3, 
	        ref_1.authorization_identifier as c4, 
	        subq_0.c6 as c5, 
	        case when (ref_4.policyname = (select schemaname from pg_catalog.pg_statio_sys_sequences limit 1 offset 2)
	                ) 
	            and
2022-01-27 12:56:22.971 UTC [14009] LOG:  terminating any other active server processes
AddressSanitizer:DEADLYSIGNAL
=================================================================
==24499==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000408 (pc 0x000001457adc bp 0x7fff966e7990 sp 0x7fff966e7980 T0)
==24499==The signal is caused by a READ memory access.
==24499==Hint: address points to the zero page.
AddressSanitizer:DEADLYSIGNAL
    #0 0x1457adc in pfree /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/utils/mmgr/../../../../../../../src/postgres/src/backend/utils/mmgr/mcxt.c:1113:2
    #1 0x13c02ad in errdetail /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/utils/error/../../../../../../../src/postgres/src/backend/utils/error/elog.c:952:2
    #2 0xfe76df in quickdie /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/tcop/../../../../../../src/postgres/src/backend/tcop/postgres.c:2672:2
    #3 0x7fcda2ec562f in _L_unlock_13 funlockfile.c:?
    #4 0x7fcd967842ef in _init ??:0:0
    #5 0x7fcd9688baa9 in yb::PgsqlResponsePB::SharedCtor() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/src/yb/common/pgsql_protocol.pb.cc:8027:18
    #6 0x7fcd9688ba1d in yb::PgsqlResponsePB::PgsqlResponsePB() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/src/yb/common/pgsql_protocol.pb.cc:7991:3
    #7 0x7fcd9f2bc054 in yb::client::YBPgsqlOp::YBPgsqlOp(std::__1::shared_ptr<yb::client::YBTable> const&) /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/client/yb_op.cc:511:44
    #8 0x7fcd9f2bd641 in yb::client::YBPgsqlReadOp::YBPgsqlReadOp(std::__1::shared_ptr<yb::client::YBTable> const&) /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/client/yb_op.cc:719:7
    #9 0x7fcd9f2bd72f in yb::client::YBPgsqlReadOp::NewSelect(std::__1::shared_ptr<yb::client::YBTable> const&) /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/client/yb_op.cc:724:41
    #10 0x7fcda42515a1 in yb::pggate::PgTableDesc::NewPgsqlSelect() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_tabledesc.cc:185:10
    #11 0x7fcda4211194 in yb::pggate::PgSelect::Prepare() /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pg_select.cc:53:27
    #12 0x7fcda414894c in yb::pggate::PgApiImpl::NewSelect(yb::PgObjectId const&, yb::PgObjectId const&, PgPrepareParameters const*, yb::pggate::PgStatement**) /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/pggate.cc:1231:3
    #13 0x7fcda410ca9f in YBCPgNewSelect /nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/../../src/yb/yql/pggate/ybc_pggate.cc:757:29
    #14 0x73966f in ybcBindScanKeys /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/access/yb_access/../../../../../../../src/postgres/src/backend/access/yb_access/yb_scan.c:746:17
    #15 0x737a86 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:1229:2
    #16 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
    #17 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
    #18 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
    #19 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
    #20 0x1357169 in SearchCatCache2 /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/utils/cache/../../../../../../../src/postgres/src/backend/utils/cache/catcache.c:1541:9
    #21 0x13abfd4 in SearchSysCache2 /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/utils/cache/../../../../../../../src/postgres/src/backend/utils/cache/syscache.c:1626:9
    #22 0x88556c in find_coercion_pathway /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_coerce.c:2251:10
    #23 0x883e8b in can_coerce_type /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_coerce.c:583:14
    #24 0x8abf33 in func_match_argtypes /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_func.c:920:7
    #25 0x8b252c in oper_select_candidate /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_oper.c:330:16
    #26 0x8b1b8a in oper /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_oper.c:431:15
    #27 0x8b35fb in make_op /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_oper.c:781:9
    #28 0x8990c7 in transformAExprNullIf /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:1057:22
    #29 0x894553 in transformExprRecurse /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:230:16
    #30 0x8976a5 in transformTypeCast /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:2718:10
    #31 0x894441 in transformExprRecurse /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:203:13
    #32 0x89dece in transformCoalesceExpr /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:2220:10
    #33 0x894401 in transformExprRecurse /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:299:13
    #34 0x8976a5 in transformTypeCast /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:2718:10
    #35 0x894441 in transformExprRecurse /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:203:13
    #36 0x8976a5 in transformTypeCast /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:2718:10
    #37 0x894441 in transformExprRecurse /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:203:13
    #38 0x89aede in transformFuncCall /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:1454:26
    #39 0x89428b in transformExprRecurse /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:266:13
    #40 0x8976a5 in transformTypeCast /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:2718:10
    #41 0x894441 in transformExprRecurse /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:203:13
    #42 0x89aede in transformFuncCall /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:1454:26
    #43 0x89428b in transformExprRecurse /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:266:13
    #44 0x898463 in transformAExprOp /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:934:11
    #45 0x894493 in transformExprRecurse /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:0:5
    #46 0x8940fe in transformExpr /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_expr.c:156:11
    #47 0x877746 in transformWhereClause /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/parse_clause.c:1733:9
    #48 0x80b9e0 in transformSelectStmt /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/analyze.c:1272:9
    #49 0x807429 in transformStmt /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/analyze.c:319:15
    #50 0x8076bf in transformOptionalSelectInto /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/analyze.c:264:9
    #51 0x806f01 in transformTopLevelStmt /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/analyze.c:214:11
    #52 0x806db8 in parse_analyze /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/parser/../../../../../../src/postgres/src/backend/parser/analyze.c:120:10
    #53 0xfe6453 in pg_analyze_and_rewrite /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/tcop/../../../../../../src/postgres/src/backend/tcop/postgres.c:698:10
    #54 0xff53d0 in exec_simple_query /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/tcop/../../../../../../src/postgres/src/backend/tcop/postgres.c:1086:20
    #55 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
    #56 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
    #57 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
    #58 0xfeb552 in PostgresMain /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/tcop/../../../../../../src/postgres/src/backend/tcop/postgres.c:5087:23
    #59 0xe38a7c in BackendRun /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/postmaster/../../../../../../src/postgres/src/backend/postmaster/postmaster.c:4470:2
    #60 0xe37885 in BackendStartup /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/postmaster/../../../../../../src/postgres/src/backend/postmaster/postmaster.c:4136:3
    #61 0xe35645 in ServerLoop /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/postmaster/../../../../../../src/postgres/src/backend/postmaster/postmaster.c:1754:7
    #62 0xe31c4a in PostmasterMain /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/postmaster/../../../../../../src/postgres/src/backend/postmaster/postmaster.c:1417:11
    #63 0xc224a9 in PostgresServerProcessMain /nfusr/dev-server/dfelsing/code/yugabyte-db/src/postgres/src/backend/main/../../../../../../src/postgres/src/backend/main/main.c:234:3
    #64 0xc22bb1 in main ??:0:0
    #65 0x7fcda2b0a554 in __libc_start_main ??:0:0
    #66 0x488738 in _start ??:0:0

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/nfusr/dev-server/dfelsing/code/yugabyte-db/build/asan-clang12-dynamic-ninja/postgres/bin/postgres+0x1457adc)
==24499==ABORTING
@def- def- added kind/bug This issue is a bug area/ysql Yugabyte SQL (YSQL) labels Jan 27, 2022
@def- def- changed the title [YSQL] AddressSanitizer: SEGV on unknown address 0x000000000408 in yb::PgsqlResponsePB::SharedCtor() [YSQL][SQLsmith] AddressSanitizer: SEGV on unknown address 0x000000000408 in yb::PgsqlResponsePB::SharedCtor() Feb 3, 2022
@yugabyte-ci yugabyte-ci added the priority/medium Medium priority issue label Jun 8, 2022
@kripasreenivasan kripasreenivasan added the qa_automation Bugs identified via itest-system, LST, Stress automation or causing automation failures label Sep 13, 2022
@yugabyte-ci yugabyte-ci added the kind/failing-test Tests and testing infra label Oct 12, 2022
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 kind/failing-test Tests and testing infra priority/medium Medium priority issue qa_automation Bugs identified via itest-system, LST, Stress automation or causing automation failures
Projects
None yet
Development

No branches or pull requests

4 participants