[BUGS] BUG #14615: ReplicationOriginShmemInit Memory access cross-border

Поиск
Список
Период
Сортировка
От bret.shao@outlook.com
Тема [BUGS] BUG #14615: ReplicationOriginShmemInit Memory access cross-border
Дата
Msg-id 20170410062621.25948.74646@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: [BUGS] BUG #14615: ReplicationOriginShmemInit Memory access cross-border  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      14615
Logged by:          bret shao
Email address:      bret.shao@outlook.com
PostgreSQL version: 9.6.2
Operating system:   linux
Description:

MemSet(replication_states, 0, ReplicationOriginShmemSize()); in function
ReplicationOriginShmemInit cause cross-border,because that start address of
the share memory allocated is replication_states_ctl, but call MemSet to
initialize this memory start from replication_states which is variable
states's address in struct ReplicationStateCtl.so call MemSet to set 0 with
the total size of this share memory will cross border of this share memory.

Although, this cross-border will not caused the system failure due to share
memory allocation strategy after my analysis. but i still believe we
shouldn't do like this.

Fix suggestion: 
change to MemSet(replication_states_ctl, 0, ReplicationOriginShmemSize()); then move
to the beginning of if statement.


--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

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

Предыдущее
От: mustafa husny
Дата:
Сообщение: [BUGS] manage connections
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [BUGS] BUG #14615: ReplicationOriginShmemInit Memory access cross-border