pgsql: Properly terminate the array returned by GetLockConflicts().

Поиск
Список
Период
Сортировка
От Andres Freund
Тема pgsql: Properly terminate the array returned by GetLockConflicts().
Дата
Msg-id E1YGxS4-00068c-O1@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Properly terminate the array returned by GetLockConflicts().

GetLockConflicts() has for a long time not properly terminated the
returned array. During normal processing the returned array is zero
initialized which, while not pretty, is sufficient to be recognized as
a invalid virtual transaction id. But the HotStandby case is more than
aesthetically broken: The allocated (and reused) array is neither
zeroed upon allocation, nor reinitialized, nor terminated.

Not having a terminating element means that the end of the array will
not be recognized and that recovery conflict handling will thus read
ahead into adjacent memory. Only terminating when hitting memory
content that looks like a invalid virtual transaction id.  Luckily
this seems so far not have caused significant problems, besides making
recovery conflict more expensive.

Discussion: 20150127142713.GD29457@awork2.anarazel.de

Backpatch into all supported branches.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/78f8c67054d0eb555cf7ef24aafb67f84b0fe65c

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


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: Properly terminate the array returned by GetLockConflicts().
Следующее
От: Andres Freund
Дата:
Сообщение: pgsql: Properly terminate the array returned by GetLockConflicts().