pgsql: Fix volatile-safety issue in asyncQueueReadAllNotifications().

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix volatile-safety issue in asyncQueueReadAllNotifications().
Дата
Msg-id E1YFmzG-00068i-6D@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix volatile-safety issue in asyncQueueReadAllNotifications().

The "pos" variable is modified within PG_TRY and then referenced
within PG_CATCH, so for strict POSIX conformance it must be marked
volatile.  Superficially the code looked safe because pos's address
was taken, which was sufficient to force it into memory ... but it's
not sufficient to ensure that the compiler applies updates exactly
where the program text says to.  The volatility marking has to extend
into a couple of subroutines too, but I think that's probably a good
thing because the risk of out-of-order updates is mostly in those
subroutines not asyncQueueReadAllNotifications() itself.  In principle
the compiler could have re-ordered operations such that an error could
be thrown while "pos" had an incorrect value.

It's unclear how real the risk is here, but for safety back-patch
to all active branches.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/93d7706cbf2ce58e63ab8bbc9d16453b2c792ed4

Modified Files
--------------
src/backend/commands/async.c |   10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix volatile-safety issue in asyncQueueReadAllNotifications().
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix volatile-safety issue in asyncQueueReadAllNotifications().