pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: bianpan2016@163.com, pgsql-bugs@lists.postgresql.org, Robert Haas <robertmhaas@gmail.com>
Subject: Re: BUG #15105: OpenTransientFile() should be paired with CloseTransientFile() rather than close()
Date: Fri, 09 Mar 2018 09:57:48 -0500
Message-ID: <19686.1520607468@sss.pgh.pa.us> (raw)
In-Reply-To: <20180309044052.GC1416@paquier.xyz>
References: <152056616579.4966.583293218357089052@wrigleys.postgresql.org>
	<20180309044052.GC1416@paquier.xyz>

Michael Paquier <michael@paquier.xyz> writes:
> On Fri, Mar 09, 2018 at 03:29:25AM +0000, PG Bug reporting form wrote:
>> Details: The handler opened with OpenTransientFile() should be closed with
>> CloseTransientFile(). However, in function dsm_impl_mmap(), on a certain
>> path, the return value of OpenTransientFile() (at line 885) is passed to
>> close() (at line 926). It is better to use CloseTransientFile() here, as
>> done at line 909.

> Good catch!  This is visibly a copy-paste error coming from
> dsm_impl_posix().  As a patch it gives the attached.  I am adding also
> Robert in CC for awareness.

Presumably, this would have been found sooner if AtEOXact_Files acted
like most other end-of-xact cleanup functions and whined about leaked
resources (in the commit case).  I wonder why it doesn't.

			regards, tom lane




view thread (5+ messages)  latest in thread

Message-ID: <19686.1520607468@sss.pgh.pa.us>
Permalink:  ../19686.1520607468@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19686.1520607468@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, robertmhaas@gmail.com
  Subject: Re: BUG #15105: OpenTransientFile() should be paired with CloseTransientFile() rather than close()
  In-Reply-To: <19686.1520607468@sss.pgh.pa.us>

* 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