BUG #17117: FailedAssertion at planner.c

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: cyg0810(at)gmail(dot)com
Subject: BUG #17117: FailedAssertion at planner.c
Date: 2021-07-21 03:28:26
Message-ID: 17117-e7ed6c3108953c08@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17117
Logged by: yaoguang chen
Email address: cyg0810(at)gmail(dot)com
PostgreSQL version: 14beta2
Operating system: Linux supersix 5.4.0-39-generic #43-Ubuntu SMP Fri
Description:

PoC:

CREATE TABLE v0 ( DEC TEXT , v3 INTEGER , v2 INTEGER , v1 INTEGER ) ;
CREATE RULE v3 AS ON INSERT TO v0 DO INSTEAD VALUES ( - ( WITH v1 ( v2 ) AS
( SELECT - - 127 INTERSECT SELECT v1 + -1 FROM v0 ) SELECT ( SELECT ( SELECT
ARRAY [ - 2147483647 , 63 , - 0 ] ) [ -2147483648 ] FROM v0 ) ) = - - 8 , -
- 75 , 25 ) ;
WITH NONE AS ( DELETE FROM v0 USING LATERAL ( SELECT * FROM ( SELECT
DISTINCT * FROM v0 POSITION WHERE ( v1 , v3 ) = ANY ( SELECT v3 , v2 FROM v0
WHERE v2 < - 61 ) AND v3 <= 59 UNION ALL SELECT * FROM v0 TABLESAMPLE SYSTEM
( - 21 ) ) v2 WHERE v3 = v1 ) v2 RETURNING * ) INSERT INTO v0 VALUES ( - - -
- - 16 , 127 , - - - - -128 ) ;

crash log:

2021-07-20 11:46:09.117 CST [1788492] HINT: Future log output will go to
log destination "csvlog".
TRAP: FailedAssertion("!parse->rowMarks && parse->commandType ==
CMD_SELECT", File:
"/home/supersix/fuzz/security/PostgreSQL/postgres/build/../src/backend/optimizer/plan/planner.c",
Line: 1868, PID: 1788610)
postgres: supersix x [local]
INSERT(ExceptionalCondition+0xbb)[0x55b8f824cffb]
postgres: supersix x [local] INSERT(+0x59480f)[0x55b8f7e5780f]
postgres: supersix x [local]
INSERT(subquery_planner+0xf63)[0x55b8f7e588e3]
postgres: supersix x [local] INSERT(SS_process_ctes+0xb9)[0x55b8f7e65b39]
postgres: supersix x [local]
INSERT(subquery_planner+0x1f9)[0x55b8f7e57b79]
postgres: supersix x [local]
INSERT(standard_planner+0x165)[0x55b8f7e59535]
postgres: supersix x [local] INSERT(pg_plan_query+0x6a)[0x55b8f7ff6eaa]
postgres: supersix x [local] INSERT(pg_plan_queries+0x4d)[0x55b8f7ff6ffd]
postgres: supersix x [local] INSERT(+0x7359f2)[0x55b8f7ff89f2]
postgres: supersix x [local] INSERT(PostgresMain+0x1ae7)[0x55b8f7ffad57]
postgres: supersix x [local] INSERT(+0x61671f)[0x55b8f7ed971f]
postgres: supersix x [local] INSERT(PostmasterMain+0x1182)[0x55b8f7edc672]
postgres: supersix x [local] INSERT(main+0x533)[0x55b8f798c133]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7fd1011130b3]
postgres: supersix x [local] INSERT(_start+0x2e)[0x55b8f798c28e]

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrey Borodin 2021-07-21 08:13:08 Re: CREATE INDEX CONCURRENTLY does not index prepared xact's data
Previous Message Tom Lane 2021-07-20 21:54:55 Re: BUG #17066: Cache lookup failed when null (unknown) is passed as anycompatiblemultirange