pgsql: radixtree: Fix crash when non-creator begins iteration over shar

From: Masahiko Sawada <msawada(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: radixtree: Fix crash when non-creator begins iteration over shar
Date: 2025-02-06 19:37:09
Message-ID: E1tg7gT-005ipX-Jo@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

radixtree: Fix crash when non-creator begins iteration over shared tree.

Previously, if a backend that attached to a shared tree attempted to
start iteration, it resulted in a crash. This commit resolves the
issue by ensuring iter_context is created in RT_ATTACH().

This fix applies only to v17, where radixtree.h was introduced. In the
master branch, this issue was separately resolved by 960013f2a1, which
eliminated the iter_context entirely.

Reviewed-by: John Naylor
Discussion: https://postgr.es/m/CAD21AoBB2U47V=F+wQRB1bERov_of5=BOZGaybjaV8FLQyqG3Q@mail.gmail.com

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9af2b3435844526ff503f2509c5246749b9c48b0

Modified Files
--------------
src/include/lib/radixtree.h | 10 ++++++++++
1 file changed, 10 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-02-06 19:41:43 pgsql: Remove support for linking with libeay32 and ssleay32
Previous Message Nathan Bossart 2025-02-06 17:59:57 pgsql: Fix autovacuum_vacuum_max_threshold's GUC description.