Re: Non-robustness in pmsignal.c
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2022-10-08T17:44:41Z
Lists: pgsql-hackers
Andres Freund <andres@anarazel.de> writes: > When can PostmasterContext be NULL here, and why can we just continue without > (re-)allocating PMChildInUse? We'd only get into the !found stanza in a postmaster or a standalone backend. A standalone backend isn't ever going to call AssignPostmasterChildSlot or ReleasePostmasterChildSlot, so it does not need the array; and it also doesn't have a PostmasterContext, so there's not a good place to allocate the array either. Perhaps there's a better way to distinguish am-I-a-postmaster, but I thought checking PostmasterContext is fine since that ties directly to what the code needs to do. Yes, the code would malfunction if the PostmasterContext != NULL condition changed from one cycle to the next, but that shouldn't happen. regards, tom lane
Commits
-
Harden pmsignal.c against clobbered shared memory.
- e7b4ff327c4d 15.1 landed
- b10546ecf826 14.6 landed
- ab35b9dd79b3 10.23 landed
- 8f98352b5ed9 12.13 landed
- 7442701374a4 13.9 landed
- 6c1de98bad93 11.18 landed
- 18a4a620e2de 16.0 landed