Re: [ADMIN] Repeatable crash in pg_dump (with -d2 info) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [ADMIN] Repeatable crash in pg_dump (with -d2 info)
Date
Msg-id 25628.1346961759@sss.pgh.pa.us
Whole thread Raw
In response to Re: [ADMIN] Repeatable crash in pg_dump (with -d2 info)  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-bugs
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


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #7521: Cannot disable WAL log while using pg_dump
Next
From: Robert Haas
Date:
Subject: Re: BUG #7521: Cannot disable WAL log while using pg_dump