pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedPG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
14+ messages / 6 participants
[nested] [flat]
Commits from this thread:
2026-10-15 73e69062c1 9b505ef6cc 57193b3a09 Fix EPQ run-time pruning using the parent's PARAM_EXEC values
2026-10-08 1b5dd3a24a 2359968b44 c7328770ba Fix incorrect reinit of run-time pruning for EPQ rechecks
* PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
@ 2026-10-01 14:27 Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
0 siblings, 1 reply; 14+ messages in thread
From: Vladimir Savin @ 2026-10-01 14:27 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org
Hi,
A backend process is terminated by SIGSEGV in run-time partition pruning
when a statement contains a FOR UPDATE CTE that has to recheck a
concurrently
updated row (EvalPlanQual) and a separate CTE that updates a partitioned
table
through an Append with run-time pruning. It reproduces on REL_18_6 and on
master.
== Steps to reproduce
Attached epq-prune-repro.sql, run against a freshly initdb'd cluster:
psql -X -d postgres -f epq-prune-repro.sql
It needs contrib/dblink, which it uses to open the second session.
The enable_* settings only force the nested loop plan on these small tables;
we first hit this with a plan the planner picked on its own (Update ->
Nested
Loop -> CTE Scan / Append with run-time pruning).
== Output I got (REL_18_6, built with --enable-cassert; master gives the
same)
psql:
COMMIT
psql:epq-prune-repro.sql:44: ERROR: 08006: server closed the connection
unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
invalid socket
CONTEXT: while executing query on dblink connection named "s2"
LOCATION: dblink_res_error, dblink.c:2863
Server log (log_error_verbosity = verbose):
2026-10-01 14:07:00.975 UTC [13783] LOG: 00000: client backend (PID
13824) was terminated by signal 11: Segmentation fault
2026-10-01 14:07:00.975 UTC [13783] DETAIL: Failed process was running:
WITH inputs AS MATERIALIZED (
... (the session 2 query above)
Backtrace of the backend core (REL_18_6):
#0 ExecEvalExprSwitchContext (state=0x7f7f7f7f7f7f7f7f,
econtext=0xaaaaf14182f0, isNull=0xffffe735e23f) at
../../../src/include/executor/executor.h:440
#1 partkey_datum_from_expr (context=0xaaaaf1418568, expr=0xaaaaf13fb440,
stateidx=0, value=0xffffe735e240, isnull=0xffffe735e23f) at partprune.c:3823
#2 perform_pruning_base_step (context=0xaaaaf1418568,
opstep=0xaaaaf13fb3f0) at partprune.c:3503
#3 get_matching_partitions (context=0xaaaaf1418568,
pruning_steps=0xaaaaf13fb4c0) at partprune.c:881
#4 find_matching_subplans_recurse (prunedata=0xaaaaf14184d0,
pprune=0xaaaaf14184d8, initial_prune=false, validsubplans=0xffffe735e488,
validsubplan_rtis=0x0)
#5 ExecFindMatchingSubPlans (prunestate=0xaaaaf1418480,
initial_prune=false, validsubplan_rtis=0x0) at execPartition.c:2535
#6 choose_next_subplan_locally (node=0xaaaaf143fe58) at nodeAppend.c:584
#7 ExecAppend (pstate=0xaaaaf143fe58) at nodeAppend.c:330
#8 ExecProcNode (node=0xaaaaf143fe58) at
../../../src/include/executor/executor.h:315
#9 ExecNestLoop (pstate=0xaaaaf142d410) at nodeNestloop.c:159
#10 ExecProcNode (node=0xaaaaf142d410) at
../../../src/include/executor/executor.h:315
#11 ExecModifyTable (pstate=0xaaaaf142c260) at nodeModifyTable.c:4280
#12 ExecProcNode (node=0xaaaaf142c260) at
../../../src/include/executor/executor.h:315
...
On master the frames are the same (partprune.c:3841, execPartition.c:2642,
nodeModifyTable.c:4497), also with state=0x7f7f7f7f7f7f7f7f.
== Output I expected
The session 2 statement completes and dblink_get_result returns updated = 8.
That is what the patched build below returns.
== Builds and settings
- REL_18_6, commit 724edf9bde9d356724ad384a2e196edc3c9f80f7:
SELECT version() = PostgreSQL 18.6 on aarch64-unknown-linux-gnu, compiled
by gcc (Debian 14.2.0-19) 14.2.0, 64-bit
- master, commit 42e96cf2fe095c822f76bc94669ea875cb1e3351:
SELECT version() = PostgreSQL 20devel on aarch64-unknown-linux-gnu,
compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit
- configure: '--prefix=/pg' '--enable-cassert' '--enable-debug'
'--without-icu' 'CFLAGS=-O0 -g'
plus `make -C contrib/dblink install`. No other deviations from the
installation instructions.
- Cluster: `initdb -A trust`, started with pg_ctl. The only postgresql.conf
change from the
initdb defaults is log_error_verbosity = verbose. No environment
variables set.
Platform: Linux 7.0.12-linuxkit #1 SMP PREEMPT aarch64 (Docker Desktop on
macOS,
Apple silicon), Debian GNU/Linux 13 (trixie), glibc 2.41-12+deb13u4,
gcc 14.2.0-19, 14 CPUs, 23 GiB RAM.
Release builds: with these exact steps the stock postgres:18.6 Docker image
(Debian 18.6-1.pgdg13+2, aarch64) returns 8 and does not crash (3 of 3
runs).
Release builds do crash on the same query shape under concurrent load from
the
Hatchet workflow engine, whose UpdateDurableEventLogEntriesSatisfied query
has
this structure:
- postgres:18.6 (18.6-1.pgdg13+2) under a synthetic load test: a segfault
every few minutes. A core taken with the dbgsym package installed has the
same frames from ExecModifyTable (called from CteScanNext) up to
ExecEvalExprSwitchContext, with frame #0 at 0x000004a00000000c.
- Google Cloud SQL for PostgreSQL 18, production: "terminated by signal 11"
in that query roughly once a day.
- postgres:17.11 under the same synthetic load: no crashes in 9 runs.
Thanks,
Vladimir Savin
--
*This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please notify the sender
immediately by replying to this email and delete it from your system.
Please do not copy, distribute, or take action based on the contents of
this email if you are not the intended recipient. Any unauthorized use or
disclosure of this email's contents is strictly prohibited.*
Attachments:
epq-prune-repro.sql (application/octet-stream, 1.9K) download
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
@ 2026-10-01 16:15 ` Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-01 19:36 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-08 08:08 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
0 siblings, 2 replies; 14+ messages in thread
From: Andrey Rachitskiy @ 2026-10-01 16:15 UTC (permalink / raw)
To: Vladimir Savin <vladimir@encord.com>; +Cc: pgsql-bugs@lists.postgresql.org
чт, 1 окт. 2026 г. в 19:28, Vladimir Savin <vladimir@encord.com>:
> Hi,
>
> A backend process is terminated by SIGSEGV in run-time partition pruning
> when a statement contains a FOR UPDATE CTE that has to recheck a
> concurrently
> updated row (EvalPlanQual) and a separate CTE that updates a partitioned
> table
> through an Append with run-time pruning. It reproduces on REL_18_6 and on
> master.
>
> == Steps to reproduce
>
> Attached epq-prune-repro.sql, run against a freshly initdb'd cluster:
>
> psql -X -d postgres -f epq-prune-repro.sql
>
> It needs contrib/dblink, which it uses to open the second session.
>
> The enable_* settings only force the nested loop plan on these small
> tables;
> we first hit this with a plan the planner picked on its own (Update ->
> Nested
> Loop -> CTE Scan / Append with run-time pruning).
>
> == Output I got (REL_18_6, built with --enable-cassert; master gives the
> same)
>
> psql:
>
> COMMIT
> psql:epq-prune-repro.sql:44: ERROR: 08006: server closed the connection
> unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> invalid socket
> CONTEXT: while executing query on dblink connection named "s2"
> LOCATION: dblink_res_error, dblink.c:2863
>
> Server log (log_error_verbosity = verbose):
>
> 2026-10-01 14:07:00.975 UTC [13783] LOG: 00000: client backend (PID
> 13824) was terminated by signal 11: Segmentation fault
> 2026-10-01 14:07:00.975 UTC [13783] DETAIL: Failed process was running:
> WITH inputs AS MATERIALIZED (
> ... (the session 2 query above)
>
> Backtrace of the backend core (REL_18_6):
>
> #0 ExecEvalExprSwitchContext (state=0x7f7f7f7f7f7f7f7f,
> econtext=0xaaaaf14182f0, isNull=0xffffe735e23f) at
> ../../../src/include/executor/executor.h:440
> #1 partkey_datum_from_expr (context=0xaaaaf1418568,
> expr=0xaaaaf13fb440, stateidx=0, value=0xffffe735e240,
> isnull=0xffffe735e23f) at partprune.c:3823
> #2 perform_pruning_base_step (context=0xaaaaf1418568,
> opstep=0xaaaaf13fb3f0) at partprune.c:3503
> #3 get_matching_partitions (context=0xaaaaf1418568,
> pruning_steps=0xaaaaf13fb4c0) at partprune.c:881
> #4 find_matching_subplans_recurse (prunedata=0xaaaaf14184d0,
> pprune=0xaaaaf14184d8, initial_prune=false, validsubplans=0xffffe735e488,
> validsubplan_rtis=0x0)
> #5 ExecFindMatchingSubPlans (prunestate=0xaaaaf1418480,
> initial_prune=false, validsubplan_rtis=0x0) at execPartition.c:2535
> #6 choose_next_subplan_locally (node=0xaaaaf143fe58) at nodeAppend.c:584
> #7 ExecAppend (pstate=0xaaaaf143fe58) at nodeAppend.c:330
> #8 ExecProcNode (node=0xaaaaf143fe58) at
> ../../../src/include/executor/executor.h:315
> #9 ExecNestLoop (pstate=0xaaaaf142d410) at nodeNestloop.c:159
> #10 ExecProcNode (node=0xaaaaf142d410) at
> ../../../src/include/executor/executor.h:315
> #11 ExecModifyTable (pstate=0xaaaaf142c260) at nodeModifyTable.c:4280
> #12 ExecProcNode (node=0xaaaaf142c260) at
> ../../../src/include/executor/executor.h:315
> ...
>
> On master the frames are the same (partprune.c:3841, execPartition.c:2642,
> nodeModifyTable.c:4497), also with state=0x7f7f7f7f7f7f7f7f.
>
>
> == Output I expected
>
> The session 2 statement completes and dblink_get_result returns updated =
> 8.
> That is what the patched build below returns.
>
>
> == Builds and settings
>
> - REL_18_6, commit 724edf9bde9d356724ad384a2e196edc3c9f80f7:
> SELECT version() = PostgreSQL 18.6 on aarch64-unknown-linux-gnu,
> compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit
> - master, commit 42e96cf2fe095c822f76bc94669ea875cb1e3351:
> SELECT version() = PostgreSQL 20devel on aarch64-unknown-linux-gnu,
> compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit
> - configure: '--prefix=/pg' '--enable-cassert' '--enable-debug'
> '--without-icu' 'CFLAGS=-O0 -g'
> plus `make -C contrib/dblink install`. No other deviations from the
> installation instructions.
> - Cluster: `initdb -A trust`, started with pg_ctl. The only
> postgresql.conf change from the
> initdb defaults is log_error_verbosity = verbose. No environment
> variables set.
>
> Platform: Linux 7.0.12-linuxkit #1 SMP PREEMPT aarch64 (Docker Desktop on
> macOS,
> Apple silicon), Debian GNU/Linux 13 (trixie), glibc 2.41-12+deb13u4,
> gcc 14.2.0-19, 14 CPUs, 23 GiB RAM.
>
> Release builds: with these exact steps the stock postgres:18.6 Docker image
> (Debian 18.6-1.pgdg13+2, aarch64) returns 8 and does not crash (3 of 3
> runs).
>
> Release builds do crash on the same query shape under concurrent load from
> the
> Hatchet workflow engine, whose UpdateDurableEventLogEntriesSatisfied query
> has
> this structure:
> - postgres:18.6 (18.6-1.pgdg13+2) under a synthetic load test: a segfault
> every few minutes. A core taken with the dbgsym package installed has the
> same frames from ExecModifyTable (called from CteScanNext) up to
> ExecEvalExprSwitchContext, with frame #0 at 0x000004a00000000c.
> - Google Cloud SQL for PostgreSQL 18, production: "terminated by signal 11"
> in that query roughly once a day.
> - postgres:17.11 under the same synthetic load: no crashes in 9 runs.
>
> Thanks,
> Vladimir Savin
>
> *This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they are
> addressed. If you have received this email in error, please notify the
> sender immediately by replying to this email and delete it from your
> system. Please do not copy, distribute, or take action based on the
> contents of this email if you are not the intended recipient. Any
> unauthorized use or disclosure of this email's contents is strictly
> prohibited.*
>
Hi, Vladimir!
Thanks for the report.
I can reproduce it on the master branch.
EvalPlanQualStart() shares the parent's PartitionPruneState so that EPQ
initializes the same Append and MergeAppend subplans (8741e48e5dd).
ExecInit of those nodes called InitExecPartitionPruneContexts() again.
That replaced exec prune ExprStates with ones allocated in the EPQ
memory context. EvalPlanQualEnd() frees that context.
A later CTE that updates a partitioned table through Nested Loop plus
Append with run-time pruning then used the dangling ExprStates and
could SIGSEGV in partkey_datum_from_expr().
Skip InitExecPartitionPruneContexts() when es_epq_active is set. A
case is added to eval-plan-qual.
--
Regards,
Rachitskiy Andrey
Attachments:
0001-Don-t-rebuild-exec-partition-prune-state-during-Eval.patch (text/x-patch, 6.0K) download
From e70de2b114bca5ad045ec64289e4d2575ff40c91 Mon Sep 17 00:00:00 2001
From: Andrey Rachitskiy <pl0h0yp1@gmail.com>
Date: Thu, 1 Oct 2026 20:11:29 +0500
Subject: [PATCH] Don't rebuild exec partition prune state during EvalPlanQual.
EvalPlanQualStart() shares the parent's PartitionPruneState so that
EPQ initializes the same Append and MergeAppend subplans. ExecInit
of those nodes called InitExecPartitionPruneContexts() again. That
replaced exec prune ExprStates with ones allocated in the EPQ memory
context. EvalPlanQualEnd() frees that context.
A later CTE that updates a partitioned table through Nested Loop plus
Append with run-time pruning then used the dangling ExprStates and
could SIGSEGV in partkey_datum_from_expr().
Skip InitExecPartitionPruneContexts() when es_epq_active is set. A
case is added to eval-plan-qual.
Author: Andrey Rachitskiy <pl0h0yp1@gmail.com>
Reported-by: Vladimir Savin <vladimir@encord.com>
Discussion: https://www.postgresql.org/message-id/CAP2G_gGpV=rKMLuET4RW-qO41GvBvi6Czsjsj16eT9hAwHxG6w@mail.gmail.com
---
src/backend/executor/execPartition.c | 6 +++-
.../isolation/expected/eval-plan-qual.out | 25 ++++++++++++++
src/test/isolation/specs/eval-plan-qual.spec | 34 +++++++++++++++++++
3 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/src/backend/executor/execPartition.c b/src/backend/executor/execPartition.c
index 86fa0f0deaa..546708ce0be 100644
--- a/src/backend/executor/execPartition.c
+++ b/src/backend/executor/execPartition.c
@@ -2038,8 +2038,12 @@ ExecInitPartitionExecPruning(PlanState *planstate,
* leave the maps to be in an invalid state, but that's ok since that data
* won't be consulted again (cf initial Assert in
* ExecFindMatchingSubPlans).
+ *
+ * EvalPlanQualStart() shares this state with the parent. Exec prune
+ * ExprStates must remain in the parent's context. EvalPlanQualEnd()
+ * destroys the EPQ estate.
*/
- if (prunestate->do_exec_prune)
+ if (prunestate->do_exec_prune && estate->es_epq_active == NULL)
InitExecPartitionPruneContexts(prunestate, planstate,
*initially_valid_subplans,
n_total_subplans);
diff --git a/src/test/isolation/expected/eval-plan-qual.out b/src/test/isolation/expected/eval-plan-qual.out
index a122047fd2a..4f33000e05a 100644
--- a/src/test/isolation/expected/eval-plan-qual.out
+++ b/src/test/isolation/expected/eval-plan-qual.out
@@ -1474,6 +1474,31 @@ step c1: COMMIT;
step s2pp4: <... completed>
step c2: COMMIT;
+starting permutation: s1epqprune s2epqprune c1 c2
+step s1epqprune: UPDATE epq_lock SET n = n + 1 WHERE id = 1;
+step s2epqprune:
+ SET LOCAL enable_hashjoin = off;
+ SET LOCAL enable_mergejoin = off;
+ SET LOCAL enable_seqscan = off;
+ WITH locked AS (
+ SELECT * FROM epq_lock WHERE id = 1 FOR UPDATE
+ ), upd AS (
+ UPDATE part_epq SET n = n + 1 + (SELECT count(*) FROM locked)
+ FROM (VALUES (1), (2)) v(id)
+ WHERE part_epq.id = v.id
+ RETURNING part_epq.id
+ )
+ SELECT count(*) FROM upd;
+ <waiting ...>
+step c1: COMMIT;
+step s2epqprune: <... completed>
+count
+-----
+ 2
+(1 row)
+
+step c2: COMMIT;
+
starting permutation: updateformergevalues mergevalues c1 c2 read
step updateformergevalues: UPDATE accounts SET balance = balance + 100;
step mergevalues:
diff --git a/src/test/isolation/specs/eval-plan-qual.spec b/src/test/isolation/specs/eval-plan-qual.spec
index fb57fb237dd..ec9b80e3131 100644
--- a/src/test/isolation/specs/eval-plan-qual.spec
+++ b/src/test/isolation/specs/eval-plan-qual.spec
@@ -47,6 +47,13 @@ setup
CREATE TABLE another_parttbl2 PARTITION OF another_parttbl FOR VALUES IN (2);
INSERT INTO another_parttbl VALUES (1, 1, 1);
+ CREATE TABLE part_epq (id int PRIMARY KEY, n int) PARTITION BY LIST (id);
+ CREATE TABLE part_epq1 PARTITION OF part_epq FOR VALUES IN (1);
+ CREATE TABLE part_epq2 PARTITION OF part_epq FOR VALUES IN (2);
+ INSERT INTO part_epq VALUES (1, 0), (2, 0);
+ CREATE TABLE epq_lock (id int PRIMARY KEY, n int);
+ INSERT INTO epq_lock VALUES (1, 0);
+
CREATE FUNCTION noisy_oper(p_comment text, p_a anynonarray, p_op text, p_b anynonarray)
RETURNS bool LANGUAGE plpgsql AS $$
DECLARE
@@ -67,6 +74,8 @@ teardown
DROP TABLE table_a, table_b, jointest;
DROP TABLE parttbl;
DROP TABLE another_parttbl;
+ DROP TABLE part_epq;
+ DROP TABLE epq_lock;
DROP FUNCTION noisy_oper(text, anynonarray, text, anynonarray)
}
@@ -205,6 +214,7 @@ step sys1 {
}
step s1pp1 { UPDATE another_parttbl SET b = b + 1 WHERE a = 1; }
+step s1epqprune { UPDATE epq_lock SET n = n + 1 WHERE id = 1; }
step updateformergevalues { UPDATE accounts SET balance = balance + 100; }
@@ -320,6 +330,27 @@ step s2pp2 { PREPARE epd AS DELETE FROM another_parttbl WHERE a = $1; }
step s2pp3 { EXECUTE epd(1); }
step s2pp4 { DELETE FROM another_parttbl WHERE a = (SELECT 1); }
+# Session 1 updates epq_lock, so the FOR UPDATE CTE does EvalPlanQual.
+# EvalPlanQualStart() initializes every planned subplan, not only the
+# EPQ target. The sibling writable CTE UPDATEs part_epq through Nested
+# Loop plus Append with run-time pruning, and shares PartitionPruneState
+# with the parent. EPQ must not rebuild those exec prune ExprStates.
+# Nested Loop still uses them after EvalPlanQualEnd().
+step s2epqprune {
+ SET LOCAL enable_hashjoin = off;
+ SET LOCAL enable_mergejoin = off;
+ SET LOCAL enable_seqscan = off;
+ WITH locked AS (
+ SELECT * FROM epq_lock WHERE id = 1 FOR UPDATE
+ ), upd AS (
+ UPDATE part_epq SET n = n + 1 + (SELECT count(*) FROM locked)
+ FROM (VALUES (1), (2)) v(id)
+ WHERE part_epq.id = v.id
+ RETURNING part_epq.id
+ )
+ SELECT count(*) FROM upd;
+}
+
step mergevalues {
MERGE INTO accounts
USING (VALUES ('checking', 610), ('savings', 620)) v(accountid, balance)
@@ -436,5 +467,8 @@ permutation sys1 sysmerge2 c1 c2
permutation s1pp1 s2pp1 s2pp2 s2pp3 c1 c2
permutation s1pp1 s2pp4 c1 c2
+# EPQ of a FOR UPDATE CTE must not rebuild exec prune state of a sibling Append
+permutation s1epqprune s2epqprune c1 c2
+
# test EPQ recheck in MERGE from VALUES_RTE, cf bug #19355
permutation updateformergevalues mergevalues c1 c2 read
--
2.53.0
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
@ 2026-10-01 19:36 ` Vladimir Savin <vladimir@encord.com>
2026-10-02 08:04 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
1 sibling, 1 reply; 14+ messages in thread
From: Vladimir Savin @ 2026-10-01 19:36 UTC (permalink / raw)
To: Andrey Rachitskiy <pl0h0yp1@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org
Hi Andrey,
Thank you for looking into this!
Is there anything else I can do to help, or are we all set?
Regards,
Vladimir
On Thu, 1 Oct 2026 at 17:15, Andrey Rachitskiy <pl0h0yp1@gmail.com> wrote:
> This is the first time you're receiving an email from this person. Make
> sure you check the email address to confirm their identity before
> interacting with the email.
>
>
>
> чт, 1 окт. 2026 г. в 19:28, Vladimir Savin <vladimir@encord.com>:
>
>> Hi,
>>
>> A backend process is terminated by SIGSEGV in run-time partition pruning
>> when a statement contains a FOR UPDATE CTE that has to recheck a
>> concurrently
>> updated row (EvalPlanQual) and a separate CTE that updates a partitioned
>> table
>> through an Append with run-time pruning. It reproduces on REL_18_6 and on
>> master.
>>
>> == Steps to reproduce
>>
>> Attached epq-prune-repro.sql, run against a freshly initdb'd cluster:
>>
>> psql -X -d postgres -f epq-prune-repro.sql
>>
>> It needs contrib/dblink, which it uses to open the second session.
>>
>> The enable_* settings only force the nested loop plan on these small
>> tables;
>> we first hit this with a plan the planner picked on its own (Update ->
>> Nested
>> Loop -> CTE Scan / Append with run-time pruning).
>>
>> == Output I got (REL_18_6, built with --enable-cassert; master gives the
>> same)
>>
>> psql:
>>
>> COMMIT
>> psql:epq-prune-repro.sql:44: ERROR: 08006: server closed the
>> connection unexpectedly
>> This probably means the server terminated abnormally
>> before or while processing the request.
>> invalid socket
>> CONTEXT: while executing query on dblink connection named "s2"
>> LOCATION: dblink_res_error, dblink.c:2863
>>
>> Server log (log_error_verbosity = verbose):
>>
>> 2026-10-01 14:07:00.975 UTC [13783] LOG: 00000: client backend (PID
>> 13824) was terminated by signal 11: Segmentation fault
>> 2026-10-01 14:07:00.975 UTC [13783] DETAIL: Failed process was running:
>> WITH inputs AS MATERIALIZED (
>> ... (the session 2 query above)
>>
>> Backtrace of the backend core (REL_18_6):
>>
>> #0 ExecEvalExprSwitchContext (state=0x7f7f7f7f7f7f7f7f,
>> econtext=0xaaaaf14182f0, isNull=0xffffe735e23f) at
>> ../../../src/include/executor/executor.h:440
>> #1 partkey_datum_from_expr (context=0xaaaaf1418568,
>> expr=0xaaaaf13fb440, stateidx=0, value=0xffffe735e240,
>> isnull=0xffffe735e23f) at partprune.c:3823
>> #2 perform_pruning_base_step (context=0xaaaaf1418568,
>> opstep=0xaaaaf13fb3f0) at partprune.c:3503
>> #3 get_matching_partitions (context=0xaaaaf1418568,
>> pruning_steps=0xaaaaf13fb4c0) at partprune.c:881
>> #4 find_matching_subplans_recurse (prunedata=0xaaaaf14184d0,
>> pprune=0xaaaaf14184d8, initial_prune=false, validsubplans=0xffffe735e488,
>> validsubplan_rtis=0x0)
>> #5 ExecFindMatchingSubPlans (prunestate=0xaaaaf1418480,
>> initial_prune=false, validsubplan_rtis=0x0) at execPartition.c:2535
>> #6 choose_next_subplan_locally (node=0xaaaaf143fe58) at
>> nodeAppend.c:584
>> #7 ExecAppend (pstate=0xaaaaf143fe58) at nodeAppend.c:330
>> #8 ExecProcNode (node=0xaaaaf143fe58) at
>> ../../../src/include/executor/executor.h:315
>> #9 ExecNestLoop (pstate=0xaaaaf142d410) at nodeNestloop.c:159
>> #10 ExecProcNode (node=0xaaaaf142d410) at
>> ../../../src/include/executor/executor.h:315
>> #11 ExecModifyTable (pstate=0xaaaaf142c260) at nodeModifyTable.c:4280
>> #12 ExecProcNode (node=0xaaaaf142c260) at
>> ../../../src/include/executor/executor.h:315
>> ...
>>
>> On master the frames are the same (partprune.c:3841, execPartition.c:2642,
>> nodeModifyTable.c:4497), also with state=0x7f7f7f7f7f7f7f7f.
>>
>>
>> == Output I expected
>>
>> The session 2 statement completes and dblink_get_result returns updated =
>> 8.
>> That is what the patched build below returns.
>>
>>
>> == Builds and settings
>>
>> - REL_18_6, commit 724edf9bde9d356724ad384a2e196edc3c9f80f7:
>> SELECT version() = PostgreSQL 18.6 on aarch64-unknown-linux-gnu,
>> compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit
>> - master, commit 42e96cf2fe095c822f76bc94669ea875cb1e3351:
>> SELECT version() = PostgreSQL 20devel on aarch64-unknown-linux-gnu,
>> compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit
>> - configure: '--prefix=/pg' '--enable-cassert' '--enable-debug'
>> '--without-icu' 'CFLAGS=-O0 -g'
>> plus `make -C contrib/dblink install`. No other deviations from the
>> installation instructions.
>> - Cluster: `initdb -A trust`, started with pg_ctl. The only
>> postgresql.conf change from the
>> initdb defaults is log_error_verbosity = verbose. No environment
>> variables set.
>>
>> Platform: Linux 7.0.12-linuxkit #1 SMP PREEMPT aarch64 (Docker Desktop on
>> macOS,
>> Apple silicon), Debian GNU/Linux 13 (trixie), glibc 2.41-12+deb13u4,
>> gcc 14.2.0-19, 14 CPUs, 23 GiB RAM.
>>
>> Release builds: with these exact steps the stock postgres:18.6 Docker
>> image
>> (Debian 18.6-1.pgdg13+2, aarch64) returns 8 and does not crash (3 of 3
>> runs).
>>
>> Release builds do crash on the same query shape under concurrent load
>> from the
>> Hatchet workflow engine, whose UpdateDurableEventLogEntriesSatisfied
>> query has
>> this structure:
>> - postgres:18.6 (18.6-1.pgdg13+2) under a synthetic load test: a segfault
>> every few minutes. A core taken with the dbgsym package installed has
>> the
>> same frames from ExecModifyTable (called from CteScanNext) up to
>> ExecEvalExprSwitchContext, with frame #0 at 0x000004a00000000c.
>> - Google Cloud SQL for PostgreSQL 18, production: "terminated by signal
>> 11"
>> in that query roughly once a day.
>> - postgres:17.11 under the same synthetic load: no crashes in 9 runs.
>>
>> Thanks,
>> Vladimir Savin
>>
>> *This email and any files transmitted with it are confidential and
>> intended solely for the use of the individual or entity to whom they are
>> addressed. If you have received this email in error, please notify the
>> sender immediately by replying to this email and delete it from your
>> system. Please do not copy, distribute, or take action based on the
>> contents of this email if you are not the intended recipient. Any
>> unauthorized use or disclosure of this email's contents is strictly
>> prohibited.*
>>
>
> Hi, Vladimir!
>
> Thanks for the report.
>
> I can reproduce it on the master branch.
>
> EvalPlanQualStart() shares the parent's PartitionPruneState so that EPQ
> initializes the same Append and MergeAppend subplans (8741e48e5dd).
> ExecInit of those nodes called InitExecPartitionPruneContexts() again.
> That replaced exec prune ExprStates with ones allocated in the EPQ
> memory context. EvalPlanQualEnd() frees that context.
>
> A later CTE that updates a partitioned table through Nested Loop plus
> Append with run-time pruning then used the dangling ExprStates and
> could SIGSEGV in partkey_datum_from_expr().
>
> Skip InitExecPartitionPruneContexts() when es_epq_active is set. A
> case is added to eval-plan-qual.
>
>
> --
> Regards,
> Rachitskiy Andrey
>
--
*This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please notify the sender
immediately by replying to this email and delete it from your system.
Please do not copy, distribute, or take action based on the contents of
this email if you are not the intended recipient. Any unauthorized use or
disclosure of this email's contents is strictly prohibited.*
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-01 19:36 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
@ 2026-10-02 08:04 ` Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-02 08:12 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
0 siblings, 1 reply; 14+ messages in thread
From: Andrey Rachitskiy @ 2026-10-02 08:04 UTC (permalink / raw)
To: Vladimir Savin <vladimir@encord.com>; +Cc: pgsql-bugs@lists.postgresql.org
пт, 2 окт. 2026 г. в 00:36, Vladimir Savin <vladimir@encord.com>:
>
> Is there anything else I can do to help, or are we all set?
>
>
Hi, Vladimir!
The patch fixes the issue, and now we just need someone to review and
approve it. So at this point we just have to wait for the maintainers to
take a look when they have time.
Also, a small request for future threads: please reply inline
(bottom-posting) — trim quotes and answer below the relevant part.
Thanks!
--
Regards,
Rachitskiy Andrey
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-01 19:36 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-02 08:04 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
@ 2026-10-02 08:12 ` Vladimir Savin <vladimir@encord.com>
0 siblings, 0 replies; 14+ messages in thread
From: Vladimir Savin @ 2026-10-02 08:12 UTC (permalink / raw)
To: Andrey Rachitskiy <pl0h0yp1@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org
On Fri, 2 Oct 2026 at 09:04, Andrey Rachitskiy <pl0h0yp1@gmail.com> wrote:
> Also, a small request for future threads: please reply inline
> (bottom-posting) — trim quotes and answer below the relevant part.
Got it, thank you Andrey!
--
*This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please notify the sender
immediately by replying to this email and delete it from your system.
Please do not copy, distribute, or take action based on the contents of
this email if you are not the intended recipient. Any unauthorized use or
disclosure of this email's contents is strictly prohibited.*
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
@ 2026-10-08 08:08 ` David Rowley <dgrowleyml@gmail.com>
2026-10-08 08:30 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
1 sibling, 1 reply; 14+ messages in thread
From: David Rowley @ 2026-10-08 08:08 UTC (permalink / raw)
To: Andrey Rachitskiy <pl0h0yp1@gmail.com>; +Cc: Vladimir Savin <vladimir@encord.com>; pgsql-bugs@lists.postgresql.org
On Fri, 2 Oct 2026 at 05:16, Andrey Rachitskiy <pl0h0yp1@gmail.com> wrote:
> Skip InitExecPartitionPruneContexts() when es_epq_active is set. A
> case is added to eval-plan-qual.
uhh, that's a pretty horrible fix. So partition pruning needs to know
what EPQ is now?
I think it would be much better to fix with the attached, which adds
an "initialized" flag to the PartitionPruneState.
Seemingly, this is all fallout from bb3ec16e1. Prior to that, the
EPQ's EState and the main executor one had different
PartitionPruneState as they were created during executor startup by
the Append / MergeAppend nodes. 8741e48e5 fixed one issue with that,
but it turns out there were repercussions to sharing the
PartitionPruneState with the EPQ's EState.
I also created a much smaller isolation test to check this works.
David
Attachments:
v2-0001-Fix-incorrect-init-of-run-time-pruning-for-EPQ-re.patch (application/octet-stream, 7.0K) download
From 10ca295d28d1822440ac66391e53e063df8e4f75 Mon Sep 17 00:00:00 2001
From: David Rowley <dgrowley@gmail.com>
Date: Thu, 8 Oct 2026 18:46:50 +1300
Subject: [PATCH v2] Fix incorrect init of run-time pruning for EPQ rechecks
For run-time partition pruning running during execution (rather than at
executor startup), EvalPlanQualStart() reuses the es_part_prune_states
from the parent EState. This can cause an issue when the EPQ recheck is
finished and its Estate is cleaned up and FreeExecutorState() deletes
the EPQ's es_query_cxt MemoryContext. That cleanup can free memory that
was allocated again in InitExecPartitionPruneContexts() when it was
called for the EPQ's EState, and naturally, those fields get allocated in
the EPQ's es_query_cxt MemoryContext, which overwrites the ones for the
parent EState. If pruning occurs again after the EPQ's EState is cleaned
up, then we can access free'd memory. This certainly causes issues in
debug builds because we clobber freed memory, but may not in production,
depending on if the MemoryContext being deleted results in a free(). It
may not if the allocation was on the context's init block and the context
was pushed onto context_freelists[] for reuse.
Here we fix this by adding an initialized field to PartitionPruneState
and bailing out early in InitExecPartitionPruneContexts() when the state
is already initialized.
This was broken by bb3ec16e1, but the breakage there is slightly
different as that commit neglected to do what was fixed in 8741e48e5
(which did get backpatched to v18 in 9a82a64ed).
Reported-by: Vladimir Savin <vladimir@encord.com>
Author: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAP2G_gGpV=rKMLuET4RW-qO41GvBvi6Czsjsj16eT9hAwHxG6w@mail.gmail.com
Backpatch-through: 18
---
src/backend/executor/execPartition.c | 12 ++++++
src/include/executor/execPartition.h | 3 ++
.../eval-plan-qual-partition-prune.out | 30 +++++++++++++
src/test/isolation/isolation_schedule | 1 +
.../specs/eval-plan-qual-partition-prune.spec | 43 +++++++++++++++++++
5 files changed, 89 insertions(+)
create mode 100644 src/test/isolation/expected/eval-plan-qual-partition-prune.out
create mode 100644 src/test/isolation/specs/eval-plan-qual-partition-prune.spec
diff --git a/src/backend/executor/execPartition.c b/src/backend/executor/execPartition.c
index 86fa0f0deaa..d89e6c370d9 100644
--- a/src/backend/executor/execPartition.c
+++ b/src/backend/executor/execPartition.c
@@ -2116,6 +2116,8 @@ CreatePartitionPruneState(EState *estate, PartitionPruneInfo *pruneinfo,
prunestate->other_subplans = bms_copy(pruneinfo->other_subplans);
prunestate->do_initial_prune = false; /* may be set below */
prunestate->do_exec_prune = false; /* may be set below */
+ prunestate->initialized = false; /* set in
+ * InitExecPartitionPruneContexts */
prunestate->num_partprunedata = n_part_hierarchies;
/*
@@ -2461,6 +2463,16 @@ InitExecPartitionPruneContexts(PartitionPruneState *prunestate,
Assert(parent_plan != NULL);
estate = parent_plan->state;
+ /*
+ * PartitionPruneStates are sometimes shared and this one may have been
+ * initialized already. Sharing of states occurs for EPQ, for example.
+ * See EvalPlanQualStart().
+ */
+ if (prunestate->initialized)
+ return;
+
+ prunestate->initialized = true;
+
/*
* No need to fix subplans maps if initial pruning didn't eliminate any
* subplans.
diff --git a/src/include/executor/execPartition.h b/src/include/executor/execPartition.h
index 82063ec2a16..001ab051b5a 100644
--- a/src/include/executor/execPartition.h
+++ b/src/include/executor/execPartition.h
@@ -113,6 +113,8 @@ typedef struct PartitionPruningData
* startup (at any hierarchy level).
* do_exec_prune true if pruning should be performed during
* executor run (at any hierarchy level).
+ * initialized true if InitExecPartitionPruneContexts has been called
+ * on this PartitionPruneState
* num_partprunedata Number of items in "partprunedata" array.
* partprunedata Array of PartitionPruningData pointers for the plan's
* partitioned relation(s), one for each partitioning
@@ -126,6 +128,7 @@ typedef struct PartitionPruneState
MemoryContext prune_context;
bool do_initial_prune;
bool do_exec_prune;
+ bool initialized;
int num_partprunedata;
PartitionPruningData *partprunedata[FLEXIBLE_ARRAY_MEMBER];
} PartitionPruneState;
diff --git a/src/test/isolation/expected/eval-plan-qual-partition-prune.out b/src/test/isolation/expected/eval-plan-qual-partition-prune.out
new file mode 100644
index 00000000000..4ec0ad036f7
--- /dev/null
+++ b/src/test/isolation/expected/eval-plan-qual-partition-prune.out
@@ -0,0 +1,30 @@
+Parsed test spec with 2 sessions
+
+starting permutation: s1_begin s1_update s2_update s1_commit s2_select
+step s1_begin: BEGIN;
+step s1_update: UPDATE lk SET n = n + 1 WHERE id = 1;
+step s2_update:
+ WITH locked AS (
+ SELECT * FROM lk WHERE id = 1 FOR UPDATE
+ ), upd AS (
+ UPDATE lp SET b = lp.b + 1 + (SELECT count(*) FROM locked)
+ FROM lp lp2 WHERE lp2.a = lp.a
+ RETURNING lp.*
+ )
+ SELECT * FROM upd ORDER BY a;
+ <waiting ...>
+step s1_commit: COMMIT;
+step s2_update: <... completed>
+a|b
+-+-
+1|3
+2|3
+(2 rows)
+
+step s2_select: SELECT * FROM lp ORDER BY a;
+a|b
+-+-
+1|3
+2|3
+(2 rows)
+
diff --git a/src/test/isolation/isolation_schedule b/src/test/isolation/isolation_schedule
index f1676a961f9..bf9a2037c70 100644
--- a/src/test/isolation/isolation_schedule
+++ b/src/test/isolation/isolation_schedule
@@ -43,6 +43,7 @@ test: fk-fastpath-null-key
test: subxid-overflow
test: eval-plan-qual
test: eval-plan-qual-trigger
+test: eval-plan-qual-partition-prune
test: inplace-inval
test: intra-grant-inplace
test: intra-grant-inplace-db
diff --git a/src/test/isolation/specs/eval-plan-qual-partition-prune.spec b/src/test/isolation/specs/eval-plan-qual-partition-prune.spec
new file mode 100644
index 00000000000..234483e8735
--- /dev/null
+++ b/src/test/isolation/specs/eval-plan-qual-partition-prune.spec
@@ -0,0 +1,43 @@
+# Test run-time partition pruning after an EPQ recheck
+
+setup
+{
+ CREATE TABLE lp (a int PRIMARY KEY, b int) PARTITION BY LIST (a);
+ CREATE TABLE lp1 PARTITION OF lp FOR VALUES IN (1);
+ CREATE TABLE lp2 PARTITION OF lp FOR VALUES IN (2);
+ INSERT INTO lp VALUES (1, 1), (2, 1);
+ CREATE TABLE lk (id int PRIMARY KEY, n int);
+ INSERT INTO lk VALUES (1, 0);
+}
+
+teardown
+{
+ DROP TABLE lp, lk;
+}
+
+session s1
+step s1_begin { BEGIN; }
+step s1_update { UPDATE lk SET n = n + 1 WHERE id = 1; }
+step s1_commit { COMMIT; }
+
+session s2
+setup
+{
+ SET enable_hashjoin = off;
+ SET enable_mergejoin = off;
+ SET enable_seqscan = off;
+}
+step s2_update
+{
+ WITH locked AS (
+ SELECT * FROM lk WHERE id = 1 FOR UPDATE
+ ), upd AS (
+ UPDATE lp SET b = lp.b + 1 + (SELECT count(*) FROM locked)
+ FROM lp lp2 WHERE lp2.a = lp.a
+ RETURNING lp.*
+ )
+ SELECT * FROM upd ORDER BY a;
+}
+step s2_select { SELECT * FROM lp ORDER BY a; }
+
+permutation s1_begin s1_update s2_update s1_commit s2_select
--
2.53.0
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 08:08 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
@ 2026-10-08 08:30 ` Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 22:04 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
0 siblings, 1 reply; 14+ messages in thread
From: Andrey Rachitskiy @ 2026-10-08 08:30 UTC (permalink / raw)
To: David Rowley <dgrowleyml@gmail.com>; +Cc: Vladimir Savin <vladimir@encord.com>; pgsql-bugs@lists.postgresql.org
чт, 8 окт. 2026 г. в 13:08, David Rowley <dgrowleyml@gmail.com>:
> On Fri, 2 Oct 2026 at 05:16, Andrey Rachitskiy <pl0h0yp1@gmail.com> wrote:
> > Skip InitExecPartitionPruneContexts() when es_epq_active is set. A
> > case is added to eval-plan-qual.
>
> uhh, that's a pretty horrible fix. So partition pruning needs to know
> what EPQ is now?
>
> I think it would be much better to fix with the attached, which adds
> an "initialized" flag to the PartitionPruneState.
>
>
Hi David!
Thanks for the review.
Agreed. Skipping on es_epq_active was answering the wrong question.
The invariant is that InitExecPartitionPruneContexts() must not run
twice on a shared PartitionPruneState.
Your initialized flag is the right fix.
LGTM
--
Regards,
Rachitskiy Andrey
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 08:08 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-08 08:30 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
@ 2026-10-08 22:04 ` David Rowley <dgrowleyml@gmail.com>
2026-10-09 14:28 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrew Dunstan <andrew@dunslane.net>
0 siblings, 1 reply; 14+ messages in thread
From: David Rowley @ 2026-10-08 22:04 UTC (permalink / raw)
To: Andrey Rachitskiy <pl0h0yp1@gmail.com>; +Cc: Vladimir Savin <vladimir@encord.com>; pgsql-bugs@lists.postgresql.org
On Thu, 8 Oct 2026 at 21:30, Andrey Rachitskiy <pl0h0yp1@gmail.com> wrote:
> Agreed. Skipping on es_epq_active was answering the wrong question.
> The invariant is that InitExecPartitionPruneContexts() must not run
> twice on a shared PartitionPruneState.
> Your initialized flag is the right fix.
Pushed.
David
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 08:08 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-08 08:30 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 22:04 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
@ 2026-10-09 14:28 ` Andrew Dunstan <andrew@dunslane.net>
2026-10-10 11:51 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Zsolt Parragi <zsolt.parragi@percona.com>
2026-10-12 00:16 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
0 siblings, 2 replies; 14+ messages in thread
From: Andrew Dunstan @ 2026-10-09 14:28 UTC (permalink / raw)
To: David Rowley <dgrowleyml@gmail.com>; Andrey Rachitskiy <pl0h0yp1@gmail.com>; +Cc: Vladimir Savin <vladimir@encord.com>; pgsql-bugs@lists.postgresql.org
On 2026-10-08 Th 6:04 PM, David Rowley wrote:
> On Thu, 8 Oct 2026 at 21:30, Andrey Rachitskiy <pl0h0yp1@gmail.com> wrote:
>> Agreed. Skipping on es_epq_active was answering the wrong question.
>> The invariant is that InitExecPartitionPruneContexts() must not run
>> twice on a shared PartitionPruneState.
>> Your initialized flag is the right fix.
> Pushed.
>
per buildfarm, this is an ABI break on release 18, apparently needs an
update to .abi-compliance-history
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 08:08 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-08 08:30 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 22:04 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-09 14:28 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrew Dunstan <andrew@dunslane.net>
@ 2026-10-10 11:51 ` Zsolt Parragi <zsolt.parragi@percona.com>
2026-10-15 02:53 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
1 sibling, 1 reply; 14+ messages in thread
From: Zsolt Parragi @ 2026-10-10 11:51 UTC (permalink / raw)
To: Andrew Dunstan <andrew@dunslane.net>; +Cc: David Rowley <dgrowleyml@gmail.com>; Andrey Rachitskiy <pl0h0yp1@gmail.com>; Vladimir Savin <vladimir@encord.com>; pgsql-bugs@lists.postgresql.org
Hello
An automated claude review pointed out a leftover issue after the fix.
> per buildfarm, this is an ABI break on release 18, apparently needs an
> update to .abi-compliance-history
The attached patch fixing that removes the initialized field again,
which should also take care of this.
EPQ EState has another problem, which the initialized flag doesn't
address: the ExprContext of the PartitionPruneState is created by
CreatePartitionPruneState() for the parent EState, so exec pruning in
the EPQ reads the parent's es_param_exec_vals. If the pruning depends
on a value from the re-fetched row, the EPQ prunes with the value from
the old row version, and can remove the partition it actually needs.
This isn't caused by 1b5dd3a24. Before it the EPQ re-initialized the
exec contexts, but with the same parent ExprContext, so this goes back
to 8741e48e5.
Repro:
CREATE TABLE p (a int, b int) PARTITION BY LIST (a);
CREATE TABLE p1 PARTITION OF p FOR VALUES IN (1);
CREATE TABLE p2 PARTITION OF p FOR VALUES IN (2);
INSERT INTO p VALUES (1, 100), (2, 200);
CREATE TABLE t (id int PRIMARY KEY, k int, v int, done bool DEFAULT false);
INSERT INTO t VALUES (1, 1, 100);
-- s1
BEGIN;
UPDATE t SET k = 2, v = 200 WHERE id = 1;
-- s2, blocks
UPDATE t SET done = true WHERE t.v = (SELECT p.b FROM p WHERE p.a =
t.k) RETURNING *;
-- s1
COMMIT;
s2 returns UPDATE 0. The recheck sees k = 2, the SubPlan sets $0 = 2
in the EPQ EState, but pruning still sees $0 = 1 from the parent, so
only p1 is kept, the scan finds nothing, and the subquery returns
NULL.
With enable_partition_pruning = off the row is updated as expected.
As David said upthread, before bb3ec16e1 the EPQ had its own
PartitionPruneStates, the sharing only came with 8741e48e5, which
fixed the missing states after that commit. The attached patch goes
back to separate states: it gives the EPQ EState its own
PartitionPruneStates, created from the parent's PartitionPruneInfos,
and keeps borrowing es_part_prune_results so the same subplans are
initialized, which was the reason for the sharing. As nothing is
shared anymore, I removed the initialized flag again. This also covers
the use-after-free, nothing in the parent state is touched by the EPQ
anymore, the existing test still passes, and so does Vladimir's
epq-prune-repro.sql.
The patch also adds the case above to the
eval-plan-qual-partition-prune isolation test.
Attachments:
v1-0001-Fix-EPQ-run-time-pruning-using-the-parent-s-PARAM.patch (application/octet-stream, 8.1K) download
From 3cd243517c3e787a3fc19e68e3a84879c3632222 Mon Sep 17 00:00:00 2001
From: Zsolt Parragi <zsolt.parragi@percona.com>
Date: Sat, 10 Oct 2026 11:22:48 +0000
Subject: [PATCH v1] Fix EPQ run-time pruning using the parent's PARAM_EXEC
values
8741e48e5 made EvalPlanQualStart() borrow the parent EState's
es_part_prune_states. However, the ExprContext in each
PartitionPruneState belongs to the parent EState, so exec pruning during
an EPQ recheck used the parent's PARAM_EXEC values, i.e. those from the
old row version. This could prune away the partition the recheck
needed, causing the row to be silently skipped, e.g. with a correlated
subquery on a partitioned table in the WHERE clause of an UPDATE.
Here we fix this by giving the EPQ EState its own PartitionPruneStates,
while still borrowing the parent's es_part_prune_results so that the
same subplans are initialized. As the states are no longer shared, the
"initialized" field added by 1b5dd3a24 is no longer needed, so remove
it. This also undoes the ABI break that field caused in 18.
Backpatch to 18, where 8741e48e5 was backpatched.
Author: Zsolt Parragi <zsolt.parragi@percona.com>
Discussion: https://postgr.es/m/CAP2G_gGpV=rKMLuET4RW-qO41GvBvi6Czsjsj16eT9hAwHxG6w@mail.gmail.com
Backpatch-through: 18
---
src/backend/executor/execMain.c | 7 +++-
src/backend/executor/execPartition.c | 42 +++++++++++++------
src/include/executor/execPartition.h | 4 +-
.../eval-plan-qual-partition-prune.out | 16 +++++++
.../specs/eval-plan-qual-partition-prune.spec | 13 +++++-
5 files changed, 65 insertions(+), 17 deletions(-)
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 2519af9e778..d7a8f36ca1d 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -3157,12 +3157,17 @@ EvalPlanQualStart(EPQState *epqstate, Plan *planTree)
* and MergeAppend subplans as the parent did.
*/
rcestate->es_part_prune_infos = parentestate->es_part_prune_infos;
- rcestate->es_part_prune_states = parentestate->es_part_prune_states;
rcestate->es_part_prune_results = parentestate->es_part_prune_results;
/* We'll also borrow the es_partition_directory from the parent state */
rcestate->es_partition_directory = parentestate->es_partition_directory;
+ /*
+ * The PartitionPruneStates can't be borrowed, though, since exec pruning
+ * must see our own es_param_exec_vals.
+ */
+ ExecCreatePartitionPruneStates(rcestate);
+
/*
* Initialize private state information for each SubPlan. We must do this
* before running ExecInitNode on the main query tree, since
diff --git a/src/backend/executor/execPartition.c b/src/backend/executor/execPartition.c
index d89e6c370d9..4ec69f2bf99 100644
--- a/src/backend/executor/execPartition.c
+++ b/src/backend/executor/execPartition.c
@@ -1965,6 +1965,36 @@ ExecDoInitialPruning(EState *estate)
}
}
+/*
+ * ExecCreatePartitionPruneStates
+ * Create a PartitionPruneState for each PartitionPruneInfo entry in
+ * estate->es_part_prune_infos, without performing initial pruning.
+ *
+ * This is for an EState that must reuse the initial pruning results of
+ * another EState, such as an EPQ recheck's EState, for which the caller must
+ * have set es_part_prune_results. The PartitionPruneStates can't be shared
+ * with the other EState, since exec pruning must evaluate PARAM_EXEC Params
+ * using this EState's es_param_exec_vals.
+ */
+void
+ExecCreatePartitionPruneStates(EState *estate)
+{
+ ListCell *lc;
+
+ Assert(estate->es_part_prune_states == NIL);
+
+ foreach(lc, estate->es_part_prune_infos)
+ {
+ PartitionPruneInfo *pruneinfo = lfirst_node(PartitionPruneInfo, lc);
+ Bitmapset *all_leafpart_rtis = NULL;
+
+ estate->es_part_prune_states =
+ lappend(estate->es_part_prune_states,
+ CreatePartitionPruneState(estate, pruneinfo,
+ &all_leafpart_rtis));
+ }
+}
+
/*
* ExecInitPartitionExecPruning
* Initialize the data structures needed for runtime "exec" partition
@@ -2116,8 +2146,6 @@ CreatePartitionPruneState(EState *estate, PartitionPruneInfo *pruneinfo,
prunestate->other_subplans = bms_copy(pruneinfo->other_subplans);
prunestate->do_initial_prune = false; /* may be set below */
prunestate->do_exec_prune = false; /* may be set below */
- prunestate->initialized = false; /* set in
- * InitExecPartitionPruneContexts */
prunestate->num_partprunedata = n_part_hierarchies;
/*
@@ -2463,16 +2491,6 @@ InitExecPartitionPruneContexts(PartitionPruneState *prunestate,
Assert(parent_plan != NULL);
estate = parent_plan->state;
- /*
- * PartitionPruneStates are sometimes shared and this one may have been
- * initialized already. Sharing of states occurs for EPQ, for example.
- * See EvalPlanQualStart().
- */
- if (prunestate->initialized)
- return;
-
- prunestate->initialized = true;
-
/*
* No need to fix subplans maps if initial pruning didn't eliminate any
* subplans.
diff --git a/src/include/executor/execPartition.h b/src/include/executor/execPartition.h
index 001ab051b5a..bcc30214e80 100644
--- a/src/include/executor/execPartition.h
+++ b/src/include/executor/execPartition.h
@@ -113,8 +113,6 @@ typedef struct PartitionPruningData
* startup (at any hierarchy level).
* do_exec_prune true if pruning should be performed during
* executor run (at any hierarchy level).
- * initialized true if InitExecPartitionPruneContexts has been called
- * on this PartitionPruneState
* num_partprunedata Number of items in "partprunedata" array.
* partprunedata Array of PartitionPruningData pointers for the plan's
* partitioned relation(s), one for each partitioning
@@ -128,12 +126,12 @@ typedef struct PartitionPruneState
MemoryContext prune_context;
bool do_initial_prune;
bool do_exec_prune;
- bool initialized;
int num_partprunedata;
PartitionPruningData *partprunedata[FLEXIBLE_ARRAY_MEMBER];
} PartitionPruneState;
extern void ExecDoInitialPruning(EState *estate);
+extern void ExecCreatePartitionPruneStates(EState *estate);
extern PartitionPruneState *ExecInitPartitionExecPruning(PlanState *planstate,
int n_total_subplans,
int part_prune_index,
diff --git a/src/test/isolation/expected/eval-plan-qual-partition-prune.out b/src/test/isolation/expected/eval-plan-qual-partition-prune.out
index 4ec0ad036f7..0980a260857 100644
--- a/src/test/isolation/expected/eval-plan-qual-partition-prune.out
+++ b/src/test/isolation/expected/eval-plan-qual-partition-prune.out
@@ -28,3 +28,19 @@ a|b
2|3
(2 rows)
+
+starting permutation: s1_begin s1_update_lt s2_update_lt s1_commit
+step s1_begin: BEGIN;
+step s1_update_lt: UPDATE lt SET k = 2, v = 2 WHERE id = 1;
+step s2_update_lt:
+ UPDATE lt SET done = true
+ WHERE lt.v = (SELECT lp.a FROM lp WHERE lp.a = lt.k)
+ RETURNING *;
+ <waiting ...>
+step s1_commit: COMMIT;
+step s2_update_lt: <... completed>
+id|k|v|done
+--+-+-+----
+ 1|2|2|t
+(1 row)
+
diff --git a/src/test/isolation/specs/eval-plan-qual-partition-prune.spec b/src/test/isolation/specs/eval-plan-qual-partition-prune.spec
index 234483e8735..2c8c2346fdb 100644
--- a/src/test/isolation/specs/eval-plan-qual-partition-prune.spec
+++ b/src/test/isolation/specs/eval-plan-qual-partition-prune.spec
@@ -8,16 +8,19 @@ setup
INSERT INTO lp VALUES (1, 1), (2, 1);
CREATE TABLE lk (id int PRIMARY KEY, n int);
INSERT INTO lk VALUES (1, 0);
+ CREATE TABLE lt (id int PRIMARY KEY, k int, v int, done bool DEFAULT false);
+ INSERT INTO lt VALUES (1, 1, 1);
}
teardown
{
- DROP TABLE lp, lk;
+ DROP TABLE lp, lk, lt;
}
session s1
step s1_begin { BEGIN; }
step s1_update { UPDATE lk SET n = n + 1 WHERE id = 1; }
+step s1_update_lt { UPDATE lt SET k = 2, v = 2 WHERE id = 1; }
step s1_commit { COMMIT; }
session s2
@@ -38,6 +41,14 @@ step s2_update
)
SELECT * FROM upd ORDER BY a;
}
+# The correlated subquery's exec pruning must use the EPQ's param values
+step s2_update_lt
+{
+ UPDATE lt SET done = true
+ WHERE lt.v = (SELECT lp.a FROM lp WHERE lp.a = lt.k)
+ RETURNING *;
+}
step s2_select { SELECT * FROM lp ORDER BY a; }
permutation s1_begin s1_update s2_update s1_commit s2_select
+permutation s1_begin s1_update_lt s2_update_lt s1_commit
--
2.55.0
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 08:08 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-08 08:30 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 22:04 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-09 14:28 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrew Dunstan <andrew@dunslane.net>
2026-10-10 11:51 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Zsolt Parragi <zsolt.parragi@percona.com>
@ 2026-10-15 02:53 ` David Rowley <dgrowleyml@gmail.com>
0 siblings, 0 replies; 14+ messages in thread
From: David Rowley @ 2026-10-15 02:53 UTC (permalink / raw)
To: Zsolt Parragi <zsolt.parragi@percona.com>; +Cc: Andrew Dunstan <andrew@dunslane.net>; Andrey Rachitskiy <pl0h0yp1@gmail.com>; Vladimir Savin <vladimir@encord.com>; pgsql-bugs@lists.postgresql.org
On Sun, 11 Oct 2026 at 00:51, Zsolt Parragi <zsolt.parragi@percona.com> wrote:
> EPQ EState has another problem, which the initialized flag doesn't
> address: the ExprContext of the PartitionPruneState is created by
> CreatePartitionPruneState() for the parent EState, so exec pruning in
> the EPQ reads the parent's es_param_exec_vals. If the pruning depends
> on a value from the re-fetched row, the EPQ prunes with the value from
> the old row version, and can remove the partition it actually needs.
>
> This isn't caused by 1b5dd3a24. Before it the EPQ re-initialized the
> exec contexts, but with the same parent ExprContext, so this goes back
> to 8741e48e5.
Thanks for finding this and for putting the patch together.
Pushed.
David
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 08:08 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-08 08:30 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 22:04 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-09 14:28 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrew Dunstan <andrew@dunslane.net>
@ 2026-10-12 00:16 ` David Rowley <dgrowleyml@gmail.com>
2026-10-15 00:12 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 1 reply; 14+ messages in thread
From: David Rowley @ 2026-10-12 00:16 UTC (permalink / raw)
To: Andrew Dunstan <andrew@dunslane.net>; +Cc: Andrey Rachitskiy <pl0h0yp1@gmail.com>; Vladimir Savin <vladimir@encord.com>; pgsql-bugs@lists.postgresql.org
On Sat, 10 Oct 2026 at 03:28, Andrew Dunstan <andrew@dunslane.net> wrote:
> per buildfarm, this is an ABI break on release 18, apparently needs an
> update to .abi-compliance-history
Thanks for highlighting that. I'll look at this once the RC1 commit
embargo is lifted. Seems Zsolt has uncovered a reason to warrant the
removal of the new flag. So it doesn't seem right to add the exception
if it'll disappear soon.
David
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 08:08 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-08 08:30 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 22:04 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-09 14:28 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrew Dunstan <andrew@dunslane.net>
2026-10-12 00:16 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
@ 2026-10-15 00:12 ` Tom Lane <tgl@sss.pgh.pa.us>
2026-10-15 01:25 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
0 siblings, 1 reply; 14+ messages in thread
From: Tom Lane @ 2026-10-15 00:12 UTC (permalink / raw)
To: David Rowley <dgrowleyml@gmail.com>; +Cc: Andrew Dunstan <andrew@dunslane.net>; Andrey Rachitskiy <pl0h0yp1@gmail.com>; Vladimir Savin <vladimir@encord.com>; Álvaro Herrera <alvherre@kurilemu.de>; pgsql-bugs@lists.postgresql.org
David Rowley <dgrowleyml@gmail.com> writes:
> On Sat, 10 Oct 2026 at 03:28, Andrew Dunstan <andrew@dunslane.net> wrote:
>> per buildfarm, this is an ABI break on release 18, apparently needs an
>> update to .abi-compliance-history
> Thanks for highlighting that. I'll look at this once the RC1 commit
> embargo is lifted. Seems Zsolt has uncovered a reason to warrant the
> removal of the new flag. So it doesn't seem right to add the exception
> if it'll disappear soon.
Could we prioritize getting that straight? Alvaro's beff3cd00 et al
have created an independent ABI break, but I don't think we can
update .abi-compliance-history for that until this earlier issue
is resolved.
regards, tom lane
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 08:08 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-08 08:30 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 22:04 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-09 14:28 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Andrew Dunstan <andrew@dunslane.net>
2026-10-12 00:16 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows David Rowley <dgrowleyml@gmail.com>
2026-10-15 00:12 ` Re: PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Tom Lane <tgl@sss.pgh.pa.us>
@ 2026-10-15 01:25 ` David Rowley <dgrowleyml@gmail.com>
0 siblings, 0 replies; 14+ messages in thread
From: David Rowley @ 2026-10-15 01:25 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Andrew Dunstan <andrew@dunslane.net>; Andrey Rachitskiy <pl0h0yp1@gmail.com>; Vladimir Savin <vladimir@encord.com>; Álvaro Herrera <alvherre@kurilemu.de>; pgsql-bugs@lists.postgresql.org
On Thu, 15 Oct 2026 at 13:12, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Could we prioritize getting that straight? Alvaro's beff3cd00 et al
> have created an independent ABI break, but I don't think we can
> update .abi-compliance-history for that until this earlier issue
> is resolved.
It's on my list for today.
David
^ permalink raw reply [nested|flat] 14+ messages in thread
end of thread, other threads:[~2026-10-15 02:53 UTC | newest]
Thread overview: 14+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01 14:27 PG18: use-after-free in exec partition pruning after an EPQ recheck in LockRows Vladimir Savin <vladimir@encord.com>
2026-10-01 16:15 ` Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-01 19:36 ` Vladimir Savin <vladimir@encord.com>
2026-10-02 08:04 ` Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-02 08:12 ` Vladimir Savin <vladimir@encord.com>
2026-10-08 08:08 ` David Rowley <dgrowleyml@gmail.com>
2026-10-08 08:30 ` Andrey Rachitskiy <pl0h0yp1@gmail.com>
2026-10-08 22:04 ` David Rowley <dgrowleyml@gmail.com>
2026-10-09 14:28 ` Andrew Dunstan <andrew@dunslane.net>
2026-10-10 11:51 ` Zsolt Parragi <zsolt.parragi@percona.com>
2026-10-15 02:53 ` David Rowley <dgrowleyml@gmail.com>
2026-10-12 00:16 ` David Rowley <dgrowleyml@gmail.com>
2026-10-15 00:12 ` Tom Lane <tgl@sss.pgh.pa.us>
2026-10-15 01:25 ` David Rowley <dgrowleyml@gmail.com>
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