Re: BUG #17094: FailedAssertion at planner.c

Richard Guo <guofenglinux@gmail.com>

From: Richard Guo <guofenglinux@gmail.com>
To: cyg0810@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-07-08T14:36:19Z
Lists: pgsql-bugs
On Thu, Jul 8, 2021 at 5:27 PM PG Bug reporting form <noreply@postgresql.org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference:      17094
> Logged by:          yaoguang chen
> Email address:      cyg0810@gmail.com
> PostgreSQL version: 14beta1
> Operating system:   Linux supersix 5.4.0-39-generic #43-Ubuntu SMP Fri
> Description:
>
> run the following sql command through client and the PostgreSQL database
> process will crash:
>
> CREATE TABLE v0 ( v4 INT , v3 INT UNIQUE , v2 INT , v1 INT UNIQUE ) ;
>  CREATE OR REPLACE RULE v1 AS ON INSERT TO v0 DO INSTEAD NOTIFY COMPRESSION
> ;
>  COPY ( SELECT 32 EXCEPT SELECT v3 + 16 FROM v0 ) TO STDOUT CSV HEADER ;
>  WITH v2 AS ( INSERT INTO v0 VALUES ( 0 ) ) DELETE FROM v0 WHERE v3 = - - -
> - 48 ;
>
>
> asan report:
>
>
> AddressSanitizer:DEADLYSIGNAL=================================================================
> ==453870==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008
>
>
Seems the Query from RewriteRule->actions may have a NULL jointree, and
that triggers the SEGV in replace_empty_jointree().

Thanks
Richard

Commits

  1. Reject cases where a query in WITH rewrites to just NOTIFY.