]> granicus.if.org Git - postgresql/commit
Fix cache flush hazard in cache_record_field_properties().
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 11 Jun 2013 21:26:48 +0000 (17:26 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 11 Jun 2013 21:26:48 +0000 (17:26 -0400)
commitfd59974f2da79bee0599673358729e30d0f72359
treeb57af9521a446e21c4ee3779683f4076a869f9df
parentc571b5168e55f2d98f5b3051ff56992edff506f5
Fix cache flush hazard in cache_record_field_properties().

We need to increment the refcount on the composite type's cached tuple
descriptor while we do lookups of its column types.  Otherwise a cache
flush could occur and release the tuple descriptor before we're done with
it.  This fails reliably with -DCLOBBER_CACHE_ALWAYS, but the odds of a
failure in a production build seem rather low (since the pfree'd descriptor
typically wouldn't get scribbled on immediately).  That may explain the
lack of any previous reports.  Buildfarm issue noted by Christian Ullrich.

Back-patch to 9.1 where the bogus code was added.
src/backend/utils/cache/typcache.c