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: FailedAssertion("!(buf[len - 1] == '\0')", File: "../../../../../src/postgres/src/common/psprintf.c", Line: 123) #11251

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

Jira Link: DB-790

Description

Found by SQLsmith. Similar to #11250 , this also happens while shutting down tserver due to #11233, also can't reproduce:

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:17:48.614 CET [63131] LOG:  server process (PID 83779) was terminated by signal 6: Abort trap
2022-01-26 22:17:48.614 CET [63131] DETAIL:  Failed process was running: select  
	  ref_5.implementation_info_id as c0, 
	  
	    pg_catalog.string_agg(
	      cast(cast(null as text) as text),
	      cast(cast(null as text) as text)) over (partition by ref_4.col order by ref_5.integer_value) as c1, 
	  subq_2.c0 as c2, 
	  subq_4.c1 as c3
	from 
	  (select  
	            ref_0.collcollate as c0
	          from 
	            pg_catalog.pg_collation as ref_0,
	            lateral (select  
	                  ref_1.grandtot as c0
	                from 
	                  public.mvtest_tvv as ref_1
	                where false
	                limit 55) as subq_0,
	            lateral (select  
	                  ref_0.collnamespace as c0
	                from 
	                  information_schema.administrable_role_authorizations as ref_2
	                where cast(null as polygon) &< cast(null as polygon)
	                limit 86) as subq_1
	          where cast(null as "timestamp") <= cast(null as date)
	          limit 120) as subq_2
	      left join information_schema.collation_character_set_applicab
2022-01-26 22:17:48.614 CET [63131] LOG:  terminating any other active server processes
2022-01-26 22:17:48.614 CET [83784] WARNING:  terminating connection because of crash of another server process
2022-01-26 22:17:48.614 CET [83784] 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:17:48.614 CET [83784] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
TRAP: FailedAssertion("!(buf[len - 1] == '\0')", File: "../../../../../src/postgres/src/common/psprintf.c", Line: 123)
2022-01-26 22:17:48.614 CET [83783] WARNING:  terminating connection because of crash of another server process at character 722
2022-01-26 22:17:48.614 CET [83783] 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:17:48.614 CET [83783] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-26 22:17:48.614 CET [83781] WARNING:  terminating connection because of crash of another server process
2022-01-26 22:17:48.614 CET [83781] 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:17:48.614 CET [83781] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-26 22:17:48.614 CET [83780] WARNING:  terminating connection because of crash of another server process
2022-01-26 22:17:48.614 CET [83780] 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:17:48.614 CET [83780] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2022-01-26 22:17:48.614 CET [83782] WARNING:  terminating connection because of crash of another server process at character 1200
2022-01-26 22:17:48.614 CET [83782] 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:17:48.614 CET [83782] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
I0126 22:17:48.614760 1868165120 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 58)
I0126 22:17:48.615003 1868738560 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 58)
I0126 22:17:48.615259 1868165120 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 58)
I0126 22:17:48.615667 1869312000 poller.cc:66] Poll stopped: Service unavailable (yb/rpc/scheduler.cc:80): Scheduler is shutting down (system error 58)
W0126 22:17:48.615669 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
W0126 22:17:48.616183 1869885440 rpc.cc:179] Aborted (yb/rpc/rpc.cc:178): Failed to schedule: 0x0000000145f77598 -> Read(tablet: 00000000000000000000000000000000, num_ops: 1, num_attempts: 2, txn: 00000000-0000-0000-0000-000000000000, subtxn: [none])
2022-01-26 22:17:48.620 CET [63131] LOG:  all server processes terminated; reinitializing

But a missing \0 at the end of the buffer could lead to out-of-bounds reads, depending on how that buffer is being used, so this seems worth investigating.

@def- def- added kind/bug This issue is a bug area/ysql Yugabyte SQL (YSQL) labels Jan 26, 2022
@def- def- changed the title [YSQL] TRAP: FailedAssertion("!(buf[len - 1] == '\0')", File: "../../../../../src/postgres/src/common/psprintf.c", Line: 123) [YSQL][SQLsmith] TRAP: FailedAssertion("!(buf[len - 1] == '\0')", File: "../../../../../src/postgres/src/common/psprintf.c", Line: 123) 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