Re: BUG #18360: Invalid memory access occurs when using geqo - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18360: Invalid memory access occurs when using geqo
Date
Msg-id 831847.1708710339@sss.pgh.pa.us
Whole thread Raw
In response to BUG #18360: Invalid memory access occurs when using geqo  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18360: Invalid memory access occurs when using geqo  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> The following script:
> SET enable_partitionwise_join = on;
> SET geqo_threshold = 2;

> CREATE TABLE t (i int) PARTITION BY LIST (i);
> CREATE TABLE tp1 PARTITION OF t FOR VALUES IN (1);
> SELECT t1.* FROM t t1 WHERE EXISTS (SELECT 1 FROM t t2 WHERE t1.i = t2.i);

> leads to a server crash with the following stack trace:

Yup, reproduces here.

> It looks like uniq_exprs points to memory located in a short-lived context
> created in geqo_eval().

Indeed.  Curiously, the in_operators list, which I thought was
parallel to that, seems fine.  Anyway, something's being careless
about which context it creates that data structure in.  Shouldn't
be too hard to fix.

I wonder whether we need a debugging mode that frees path detritus
under the same rules as GEQO does, even for single-relation queries.
This sort of problem can escape notice for a long time.

            regards, tom lane



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18360: Invalid memory access occurs when using geqo
Next
From: Tom Lane
Date:
Subject: Re: BUG #18360: Invalid memory access occurs when using geqo