pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tatsuo Ishii <ishii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix bug with view locking code.
Date: Sat, 31 Mar 2018 00:29:11 +0000
Message-ID: <E1f24ON-0004iv-Ic@gemulon.postgresql.org> (raw)

Fix bug with view locking code.

LockViewRecurese() obtains view relation using heap_open() and passes
it to get_view_query() to get view info. It immediately closes the
relation then uses the returned view info by calling
LockViewRecurse_walker().  Since get_view_query() returns a pointer
within the relcache, the relcache should be kept until
LockViewRecurse_walker() returns. Otherwise the relation could point
to a garbage memory area.

Fix is moving the heap_close() call after LockViewRecurse_walker().

Problem reported by Tom Lane (buildfarm is unhappy, especially prion
since it enables -DRELCACHE_FORCE_RELEASE cpp flag), fix by me.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1b26bd4089a388929c644ffea2832f3841c25969

Modified Files
--------------
src/backend/commands/lockcmds.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)



Message-ID: <E1f24ON-0004iv-Ic@gemulon.postgresql.org>
Permalink:  ../E1f24ON-0004iv-Ic@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1f24ON-0004iv-Ic@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: ishii@postgresql.org
  Subject: Re: pgsql: Fix bug with view locking code.
  In-Reply-To: <E1f24ON-0004iv-Ic@gemulon.postgresql.org>
  References: <E1f24ON-0004iv-Ic@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox