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] TRAP: BadArgument("!(((context) != ((void*)0) && (((((const Node*)((context)))->type) == T_AllocSetContext) || ((((const Node*)((context)))->type) == T_SlabContext) || ((((const Node*)((context)))->type) == T_GenerationContext))))", File: #11250

Open
def- opened this issue Jan 26, 2022 · 1 comment
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 26, 2022

Jira Link: DB-2757

Description

SQLsmith found this, happens sometimes when tserver is shutting down due to #11233 , but I can't reproduce it.

TRAP: FailedAssertion("!(bms_is_subset(appendrel->lateral_relids, required_outer))", File: "../../../../../../../src/postgres/src/backend/optimizer/util/relnode.c", Line: 1543)
2022-01-26 22:05:00.671 CET [82150] WARNING:  there is no transaction in progress
2022-01-26 22:05:00.671 CET [63131] LOG:  server process (PID 82149) was terminated by signal 6: Abort trap
2022-01-26 22:05:00.671 CET [63131] DETAIL:  Failed process was running: select  
	  subq_0.c4 as c0, 
	  ref_1.datallowconn as c1, 
	  74 as c2, 
	  subq_1.c0 as c3
	from 
	  (select  
	          ref_0.indexrelname as c0, 
	          ref_0.relid as c1, 
	          ref_0.indexrelname as c2, 
	          37 as c3, 
	          ref_0.relid as c4
	        from 
	          pg_catalog.pg_statio_sys_indexes as ref_0
	        where true
	        limit 93) as subq_0
	    inner join pg_catalog.pg_database as ref_1
	    on (subq_0.c3 = ref_1.encoding ),
	  lateral (select  
	        subq_0.c2 as c0
	      from 
	        information_schema.role_column_grants as ref_2
	          right join pg_catalog.pg_file_settings as ref_3
	          on (ref_1.datistemplate is NULL)
	      where cast(null as tinterval) #<> cast(null as reltime)) as subq_1
	where ((select sent_lsn from pg_catalog.pg_stat_replication limit 1 offset 3)
	       < pg_catalog.pg_current_wal_flush_lsn()) 
	  and ((select type from pg_catalog.pg_hba_file_rules limit 1 offset 1)
	       >= cast(nullif(cast(null as text),
	      cast(null as text)) as text))
	lim
2022-01-26 22:05:00.671 CET [63131] LOG:  terminating any other active server processes
2022-01-26 22:05:00.671 CET [82150] WARNING:  terminating connection because of crash of another server process
2022-01-26 22:05:00.671 CET [82150] 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-26 22:05:00.671 CET [82150] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
TRAP: BadArgument("!(((context) != ((void*)0) && (((((const Node*)((context)))->type) == T_AllocSetContext) || ((((const Node*)((context)))->type) == T_SlabContext) || ((((const Node*)((context)))->type) == T_GenerationContext))))", File: "../../../../../../../src/postgres/src/include/utils/memutils.h", Line: 134)
2022-01-26 22:05:00.671 CET [82152] WARNING:  terminating connection because of crash of another server process
2022-01-26 22:05:00.671 CET [82152] 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-26 22:05:00.671 CET [82152] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-26 22:05:00.671 CET [82148] WARNING:  terminating connection because of crash of another server process
2022-01-26 22:05:00.671 CET [82148] 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-26 22:05:00.671 CET [82148] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-26 22:05:00.671 CET [82147] WARNING:  terminating connection because of crash of another server process
2022-01-26 22:05:00.671 CET [82147] 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-26 22:05:00.671 CET [82147] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
I0126 22:05:00.671818 1869312000 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 58)
W0126 22:05:00.671958 1869885440 outbound_call.cc:131] Failed to schedule invoking callback on response for request yb.tserver.TabletServerService.Read to 127.0.0.1: Aborted (yb/rpc/thread_pool.cc:260): Service is shutting down
I0126 22:05:00.671972 1868165120 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 58)
I0126 22:05:00.672281 1868738560 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 58)
W0126 22:05:00.672427 1869885440 rpc.cc:179] Aborted (yb/rpc/rpc.cc:178): Failed to schedule: 0x0000000125e105b8 -> Read(tablet: 00000000000000000000000000000000, num_ops: 1, num_attempts: 2, txn: 00000000-0000-0000-0000-000000000000, subtxn: [none])
I0126 22:05:00.672461 1868738560 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 58)
2022-01-26 22:05:00.676 CET [63131] LOG:  all server processes terminated; reinitializing

The context null pointer looks like it could cause more trouble in Release builds too.

@def- def- added kind/bug This issue is a bug area/ysql Yugabyte SQL (YSQL) labels Jan 26, 2022
@def-
Copy link
Contributor Author

def- commented Jan 26, 2022

Sometimes comes from mmcxt.c, but seems to be the same assert:

TRAP: BadArgument("!(((context) != ((void*)0) && (((((const Node*)((context)))->type) == T_AllocSetContext) || ((((const Node*)((context)))->type) == T_SlabContext) || ((((const Node*)((context)))->type) == T_GenerationContext))))", File: "../../../../../../../src/postgres/src/backend/utils/mmgr/mcxt.c", Line: 1008)

@def- def- changed the title [YSQL] TRAP: BadArgument("!(((context) != ((void*)0) && (((((const Node*)((context)))->type) == T_AllocSetContext) || ((((const Node*)((context)))->type) == T_SlabContext) || ((((const Node*)((context)))->type) == T_GenerationContext))))", File: "../../../../../../../src/postgres/src/include/utils/memutils.h", Line: 134) [YSQL][SQLsmith] TRAP: BadArgument("!(((context) != ((void*)0) && (((((const Node*)((context)))->type) == T_AllocSetContext) || ((((const Node*)((context)))->type) == T_SlabContext) || ((((const Node*)((context)))->type) == T_GenerationContext))))", File: "../../../../../../../src/postgres/src/include/utils/memutils.h", Line: 134) Feb 3, 2022
@yugabyte-ci yugabyte-ci added the priority/medium Medium priority issue label Jun 24, 2022
@yugabyte-ci yugabyte-ci changed the title [YSQL][SQLsmith] TRAP: BadArgument("!(((context) != ((void*)0) && (((((const Node*)((context)))->type) == T_AllocSetContext) || ((((const Node*)((context)))->type) == T_SlabContext) || ((((const Node*)((context)))->type) == T_GenerationContext))))", File: "../../../../../../../src/postgres/src/include/utils/memutils.h", Line: 134) [YSQL][SQLsmith] TRAP: BadArgument("!(((context) != ((void*)0) && (((((const Node*)((context)))->type) == T_AllocSetContext) || ((((const Node*)((context)))->type) == T_SlabContext) || ((((const Node*)((context)))->type) == T_GenerationContext))))", File: Jul 9, 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