agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
pgsql: Fix shared memory size of template code for custom fixed-sized p
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix shared memory size of template code for custom fixed-sized p
@ 2026-04-06 23:24  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2026-04-06 23:24 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix shared memory size of template code for custom fixed-sized pgstats

On HEAD, the template code for custom fixed-sized pgstats is in the test
module test_custom_stats.  On REL_18_STABLE, this code lives in the test
module injection_points.

Both cases were underestimating the size of the shared memory area
required for the storage of the stats data, using a single entry rather
than the whole area.  This underestimation meant that there was no
memory allocated for the LWLock required for the stats, and even more.
This problem would be also misleading for extension developers looking
at this code.

This issue has been noticed while digging into a different bug reported
by Heikki Linnakangas, showing that the underestimation was causing
failures in the TAP tests of the test modules for 32-bit builds.  The
other issue reported, related to the memory allocation of custom
fixed-sized pgstats, will be fixed in a follow-up commit.

Discussion: https://postgr.es/m/adMk_lWbnz3HDOA8@paquier.xyz
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/98979578055ffba3bd520adcec00881f72fc2861

Modified Files
--------------
src/test/modules/test_custom_stats/test_custom_fixed_stats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix shared memory size of template code for custom fixed-sized p
@ 2026-04-06 23:24  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2026-04-06 23:24 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix shared memory size of template code for custom fixed-sized pgstats

On HEAD, the template code for custom fixed-sized pgstats is in the test
module test_custom_stats.  On REL_18_STABLE, this code lives in the test
module injection_points.

Both cases were underestimating the size of the shared memory area
required for the storage of the stats data, using a single entry rather
than the whole area.  This underestimation meant that there was no
memory allocated for the LWLock required for the stats, and even more.
This problem would be also misleading for extension developers looking
at this code.

This issue has been noticed while digging into a different bug reported
by Heikki Linnakangas, showing that the underestimation was causing
failures in the TAP tests of the test modules for 32-bit builds.  The
other issue reported, related to the memory allocation of custom
fixed-sized pgstats, will be fixed in a follow-up commit.

Discussion: https://postgr.es/m/adMk_lWbnz3HDOA8@paquier.xyz
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/af04b04f2f7a54ba4a4418a814f57b27d8e0d10c

Modified Files
--------------
src/test/modules/injection_points/injection_stats_fixed.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-04-06 23:24 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-06 23:24 pgsql: Fix shared memory size of template code for custom fixed-sized p Michael Paquier <michael@paquier.xyz>
2026-04-06 23:24 pgsql: Fix shared memory size of template code for custom fixed-sized p Michael Paquier <michael@paquier.xyz>

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