pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18360: Invalid memory access occurs when using geqo
Date: Fri, 23 Feb 2024 12:45:39 -0500
Message-ID: <831847.1708710339@sss.pgh.pa.us> (raw)
In-Reply-To: <18360-a23caf3157f34e62@postgresql.org>
References: <18360-a23caf3157f34e62@postgresql.org>

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





view thread (3+ messages)  latest in thread

Message-ID: <831847.1708710339@sss.pgh.pa.us>
Permalink:  ../831847.1708710339@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/831847.1708710339@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18360: Invalid memory access occurs when using geqo
  In-Reply-To: <831847.1708710339@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox