postgresql/src
Tom Lane 68bfe36c51 On NetBSD, force dynamic symbol resolution at postmaster start.
The default of lazy symbol resolution means that when the postmaster
first reaches the select() call in ServerLoop, it'll need to resolve
the link to that libc entry point.  NetBSD's dynamic loader takes
an internal lock while doing that, and if a signal interrupts the
operation then there is a risk of self-deadlock should the signal
handler do anything that requires that lock, as several of the
postmaster signal handlers do.  The window for this is pretty narrow,
and timing considerations make it unlikely that a signal would arrive
right then anyway.  But it's semi-repeatable on slow single-CPU
machines, and in principle the race could happen with any hardware.

The least messy solution to this is to force binding of dynamic
symbols at postmaster start, using the "-z now" linker option.
While we're at it, also use "-z relro" so as to provide a small
security gain.

It's not entirely clear whether any other platforms share this
issue, but for now we'll assume it's NetBSD-specific.  (We might
later try to use "-z now" on more platforms for performance
reasons, but that would not likely be something to back-patch.)

Report and patch by me; the idea to fix it this way is from
Andres Freund.

Discussion: https://postgr.es/m/3384826.1661802235@sss.pgh.pa.us
2022-08-30 17:29:13 -04:00
..
backend Prevent WAL corruption after a standby promotion. 2022-08-29 11:55:49 -04:00
bin pg_upgrade: Fix some minor code issues 2022-08-13 00:15:59 +02:00
common Inhibit mingw CRT's auto-globbing of command line arguments 2022-04-25 15:50:07 -04:00
fe_utils Clean up assorted failures under clang's -fsanitize=undefined checks. 2022-03-03 18:13:24 -05:00
include Repair rare failure of MULTIEXPR_SUBLINK subplans in inherited updates. 2022-08-27 12:11:20 -04:00
interfaces Add missing bad-PGconn guards in libpq entry points. 2022-08-15 15:40:07 -04:00
makefiles
pl Translation updates 2022-08-08 12:39:52 +02:00
port Stamp 12.12. 2022-08-08 16:47:33 -04:00
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:29:13 -04:00
test Repair rare failure of MULTIEXPR_SUBLINK subplans in inherited updates. 2022-08-27 12:11:20 -04:00
timezone Update time zone data files to tzdata release 2022a. 2022-05-05 14:55:17 -04:00
tools Improve setup of environment values for commands in MSVC's vcregress.pl 2022-05-11 10:22:37 +09:00
tutorial tutorial: land height is "elevation", not "altitude" 2021-03-10 20:25:18 -05:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in Fix prove_installcheck to use correct paths when used with PGXS 2021-07-01 08:47:04 -04:00
Makefile.shlib Fix pkg-config files for static linking 2021-09-06 09:43:18 +02:00
nls-global.mk