Re: Postmaster self-deadlock due to PLT linkage resolution
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-09-05T02:28:48Z
Lists: pgsql-hackers
On Wed, Aug 31, 2022 at 1:34 AM Thomas Munro <thomas.munro@gmail.com> wrote: > On Wed, Aug 31, 2022 at 12:26 AM Robert Haas <robertmhaas@gmail.com> wrote: > > On Tue, Aug 30, 2022 at 8:17 AM Thomas Munro <thomas.munro@gmail.com> wrote: > > > FWIW I suspect FreeBSD can't break like this in a program linked with > > > libthr, because it has a scheme for deferring signals while the > > > runtime linker holds locks. _rtld_bind calls _thr_rtld_rlock_acquire, > > > which uses the THR_CRITICAL_ENTER mechanism to cause thr_sighandler to > > > defer until release. For a non-thread program, I'm not entirely sure, > > > but I don't think the fork() problem exists there. (Could be wrong, > > > based on a quick look.) > > > > Well that seems a bit ironic, considering that Tom has worried in the > > past that linking with threading libraries would break stuff. > > Hah. To clarify, non-thread builds don't have that exact fork() > problem, but it turns out they do have a related state clobbering > problem elsewhere, which I've reported. For the record, reporting that resulted in a change for non-libthr rtld: https://cgit.freebsd.org/src/commit/?id=a687683b997c5805ecd6d8278798b7ef00d9908f
Commits
-
Use WaitEventSet API for postmaster's event loop.
- 7389aad63666 16.0 cited
-
On NetBSD, force dynamic symbol resolution at postmaster start.
- 5bed28e699ec 10.23 landed
- 6fd58ca7703a 11.18 landed
- 68bfe36c5173 12.13 landed
- a94b019d44e5 13.9 landed
- 464db46760d2 14.6 landed
- 529d8f3736a1 15.0 landed
- 8acd8f8690ed 16.0 landed