Re: [PATCH] Two remaining shmem attachment issues in single-user mode - Mailing list pgsql-hackers

From Alexander Lakhin
Subject Re: [PATCH] Two remaining shmem attachment issues in single-user mode
Date
Msg-id e87c8fef-e254-441e-b889-bbcbd5afea7f@gmail.com
Whole thread
In response to Re: [PATCH] Two remaining shmem attachment issues in single-user mode  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: [PATCH] Two remaining shmem attachment issues in single-user mode
List pgsql-hackers
Hello Heikki,

30.09.2026 14:43, Heikki Linnakangas wrote:
> Ok, I picked a mix of these test changes that I liked the best, and committed :-). Thank you both!
>

Please look at a failure of 001_late_shmem_alloc.pl, produced recently by
mamba [1]:
# +++ tap check in src/test/modules/test_shmem +++
# die: ack Broken pipe: write( 13, '
# -- allocate
# SELECT test_shmem_register('test_shmem after startup', 25, 1);
# -- attach
# SELECT test_shmem_register('test_shmem after startup', 25, 2);
# -- attach with SHMEM_ATTACH_UNKNOWN_SIZE
# SELECT test_shmem_register('test_shmem after startup', -1, 3);
# ' ) at /usr/pkg/lib/perl5/vendor_perl/5.42.0/IPC/Run/IO.pm line 550.
# Looks like your test exited with 32 just after 12.
[05:53:14] t/001_late_shmem_alloc.pl ..
Dubious, test returned 32 (wstat 8192, 0x2000)
All 12 subtests passed
     (less 2 skipped subtests: 10 okay)
[05:53:14]

It looks like postmaster that is doomed to fail ("Cannot use
SHMEM_ATTACH_UNKNOWN_SIZE with a segment that doesn't exist") can exit
before it processes stdin from TAP test. I've managed to reproduce it with
slow_write.c attached as below:
LD_PRELOAD=.../slow_write.so PROVE_TESTS='t/001*' make -s check -C src/test/modules/test_shmem
# +++ tap check in src/test/modules/test_shmem +++
t/001_late_shmem_alloc.pl .. 11/? # die: ack Broken pipe: write( 13, '
...
# Looks like your test exited with 32 just after 12.
t/001_late_shmem_alloc.pl .. Dubious, test returned 32 (wstat 8192, 0x2000)
All 12 subtests passed

Without this test,
LD_PRELOAD=.../slow_write.so make -s check-world
passes for me.

Note that mamba has
# IPC::Run::VERSION: 20250809.0
This issue is not reproduced with 20260402.0.

[1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mamba&dt=2026-10-01%2006%3A10%3A51

Best regards,
Alexander
Attachment

pgsql-hackers by date:

Previous
From: Ayush Tiwari
Date:
Subject: Re: Buffer pin leak in hash index bucket splits
Next
From: Rahul
Date:
Subject: Re: Wrong LSN in WAL decoding error messages