pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: David Schnur <dnschnur@gmail.com>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-bugs@postgresql.org
Subject: Re: [ADMIN] Repeatable crash in pg_dump (with -d2 info)
Date: Thu, 06 Sep 2012 16:02:39 -0400
Message-ID: <25628.1346961759@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoZ0ommY=R9mMxOPKcqr5KgwnUgN5Ncjg2f92=EW8rtbJQ@mail.gmail.com>
References: <CAANiQEm92w70rapQhitV1qL0tpkNRo5qjpwo2fdg+iZ-AURMCg@mail.gmail.com>
	<28131.1322067903@sss.pgh.pa.us>
	<CAANiQE=fjCFLp2DvUM9r3GVA4+khuyaQ9UFaee7HzFzEkJuYvw@mail.gmail.com>
	<346.1322071656@sss.pgh.pa.us>
	<CAANiQEndAdY+_tF_Pb7njmuQAQUsN+_gBYPOi6TtLNGPEBGUZg@mail.gmail.com>
	<29791.1322528434@sss.pgh.pa.us>
	<CAANiQEkmH19QOL5TYd1j2+qjUWERyMf9engUDDwB7GNo8aNLHw@mail.gmail.com>
	<20120827135852.GG11088@momjian.us>
	<CA+TgmoZ0ommY=R9mMxOPKcqr5KgwnUgN5Ncjg2f92=EW8rtbJQ@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Aug 27, 2012 at 9:58 AM, Bruce Momjian <bruce@momjian.us> wrote:
>> From Tom Lane in the above thread:
>>> Hmm.  I can see how that would happen if you're using one of the Windows
>>> environments wherein malloc's done inside libpq have to be free'd inside
>>> libpq.  (The PQExpBuffer support code is in libpq...)

>> Late reply, but I don't see any way we could fix this easily.

> To me it seems like mostly a case of chasing down all the places where
> this happens.  It's not impossible to do; it's just a bunch of work
> that nobody's gotten excited about doing yet.  We've fixed similar
> issues in many other cases, IIUC.

Well, the problem with what I suspect you're thinking of is that even
after we fixed all the existing trouble spots, it would keep on
breaking.  Unless we found some mechanical way to warn about unsafe
coding; which in itself would be more work than I want to put into this.

However, a plan B occurs to me: what about preventing pg_dump from using
libpq's copy of PQExpBuffer?  IIUC, a copy of the PQExpBuffer code
statically linked into pg_dump would be free of this problem.  There's
not so much code there that this would be an intolerable price to pay.
(Besides, we could probably arrange for the extra copy to happen only on
Windows.)

			regards, tom lane




view thread (12+ messages)

Message-ID: <25628.1346961759@sss.pgh.pa.us>
Permalink:  ../25628.1346961759@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25628.1346961759@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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, bruce@momjian.us, dnschnur@gmail.com, pgsql-bugs@postgresql.org
  Subject: Re: [ADMIN] Repeatable crash in pg_dump (with -d2 info)
  In-Reply-To: <25628.1346961759@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