Re: pgsql: Perform provider-specific initialization in new functions.

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Jeff Davis <jdavis(at)postgresql(dot)org>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Perform provider-specific initialization in new functions.
Date: 2026-03-06 15:24:30
Message-ID: D18AD72A-5004-4EF8-AF80-10732AF677FA@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

> On 3 Dec 2024, at 12:27, Jeff Davis <jdavis(at)postgresql(dot)org> wrote:
>
> Perform provider-specific initialization in new functions.
>
> Reviewed-by: Andreas Karlsson
> Discussion: https://postgr.es/m/4548a168-62cd-457b-8d06-9ba7b985c477@proxel.se

Hi Jeff!

I'm toying with my WAL compression patch. This test is segfaulting for me:

src/test/recovery % PROVE_TESTS="t/001_stream_rep.pl" PGOPTIONS="-c wal_compression=lz4" make check

in src/test/recovery/tmp_check/log/001_stream_rep_primary.log I observe:

2026-03-06 20:03:01.433 +05 [24424] 001_stream_rep.pl LOG: statement: GRANT pg_read_all_settings TO repl_role;
2026-03-06 20:03:01.441 +05 [24318] LOG: client backend (PID 24426) was terminated by signal 11: Segmentation fault: 11
2026-03-06 20:03:01.441 +05 [24318] LOG: terminating any other active server processes

I do not expect it to pass, it would never pass with given arguments. But I do
not expect it to segfault either.

I bisected the problem, some tome ago this test would fail with something like
"permission denied to change wal_compression". And that seems good.
Later it became "Cannot find collation for ..."
And after 1ba0782ce90cb4261098de59b49ae5cb2326566b it crashes.

wal_compression is PGC_SUSET, so when a non-superuser sets it via the startup
packet (PGC_BACKEND context), set_config_with_handle must call
pg_parameter_aclcheck -> SearchSysCache1(PARAMETERACLNAME, ...) -> hashtext ->
pg_newlocale_from_collation(DEFAULT_COLLATION_OID).

I do not know if it's expected, so I decided to report this problem, just in case.
I can suggest something in a line with attached, but it's kind of point-in-the-sky fix.

Best regards, Andrey Borodin.

Attachment Content-Type Size
fix.diff application/octet-stream 1.1 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Álvaro Herrera 2026-03-06 15:25:50 pgsql: Don't include wait_event.h in pgstat.h
Previous Message Peter Eisentraut 2026-03-06 09:49:19 pgsql: doc: Fix capitalization of Unicode