pgsql: Be more wary about partially-valid LOCALLOCK data in RemoveLocal

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Be more wary about partially-valid LOCALLOCK data in RemoveLocal
Дата
Msg-id E1ZdlXu-0003y0-FA@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Be more wary about partially-valid LOCALLOCK data in RemoveLocalLock().

RemoveLocalLock() must consider the possibility that LockAcquireExtended()
failed to palloc the initial space for a locallock's lockOwners array.
I had evidently meant to cope with this hazard when the code was originally
written (commit 1785acebf2ed14fd66955e2d9a55d77a025f418d), but missed that
the pfree needed to be protected with an if-test.  Just to make sure things
are left in a clean state, reset numLockOwners as well.

Per low-memory testing by Andreas Seltenreich.  Back-patch to all supported
branches.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/eed5bbc48026976444dc020086559acc8e6f26ca

Modified Files
--------------
src/backend/storage/lmgr/lock.c |    7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Michael Meskes
Дата:
Сообщение: pgsql: Let compiler handle size calculation of bool types.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Be more wary about partially-valid LOCALLOCK data in RemoveLocal