| From: | Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com> |
|---|---|
| To: | Alexander Lakhin <exclusion(at)gmail(dot)com> |
| Cc: | Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: [PATCH] Two remaining shmem attachment issues in single-user mode |
| Date: | 2026-10-11 12:50:07 |
| Message-ID: | CAJTYsWVO7jhqypYUBtCa4A=qDvz_ypZA-Gs6+6mqxoR1Z0gYxw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
On Sun, 11 Oct 2026 at 12:30, Alexander Lakhin <exclusion(at)gmail(dot)com> wrote:
>
> 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
Thanks for the reproducer. I get the same failure with your slow_write.c.
The last test expects postgres to fail during startup, but we're still
sending it the SQL from the previous test. If postgres exits before the
write, the test script gets a broken pipe. I think we can just give this
test empty input instead.
The attached patch does that. Both error checks are unchanged, and it
passes here with and without your reproducer.
Thoughts?
Regards,
Ayush
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-Avoid-stdin-writes-in-the-shmem-startup-failure-test.patch | application/octet-stream | 1.2 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ayush Tiwari | 2026-10-11 13:15:05 | Re: Add a pg_wal_preallocate() SQL function to eagerly create future WAL segments |
| Previous Message | Richard Guo | 2026-10-11 12:41:03 | Re: Wrong results from an antijoin |