Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8E510B5DBDE for ; Wed, 5 Oct 2011 01:07:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 89665-02 for ; Wed, 5 Oct 2011 04:06:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 33342B5DBC7 for ; Wed, 5 Oct 2011 01:06:56 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p9546pJD009005; Wed, 5 Oct 2011 00:06:51 -0400 (EDT) To: Alvaro Herrera cc: Pavel Holec , "'Craig Ringer'" , Pg Bugs Subject: Re: BUG #6233: pg_dump hangs with Access Violation C0000005 In-reply-to: <1317784584-sup-6771@alvh.no-ip.org> References: <201109282118.p8SLIwYx099581@wwwmaster.postgresql.org> <4E8422B0.5060404@ringerc.id.au> <4E8A72E3.9080701@ringerc.id.au> <6027.1317776669@sss.pgh.pa.us> <1317784584-sup-6771@alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Wed, 05 Oct 2011 00:28:36 -0300" Date: Wed, 05 Oct 2011 00:06:50 -0400 Message-ID: <9004.1317787610@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/38 X-Sequence-Number: 31308 Alvaro Herrera writes: > Excerpts from Tom Lane's message of mar oct 04 22:04:29 -0300 2011: >> 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...) > Isn't this the kind of thing that you have to enable explicitly? I'm looking at our docs for PQfreemem: Frees memory allocated by libpq, particularly PQescapeByteaConn, PQescapeBytea, PQunescapeBytea, and PQnotifies. It is particularly important that this function, rather than free(), be used on Microsoft Windows. This is because allocating memory in a DLL and releasing it in the application works only if multithreaded/single-threaded, release/debug, and static/dynamic flags are the same for the DLL and the application. On non-Microsoft Windows platforms, this function is the same as the standard library function free(). I have no idea how accurate or complete that third sentence is; but perhaps the OP is trying to use a libpq.dll that was built separately from his pg_dump executable? regards, tom lane