Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 035B2B5DC17 for ; Wed, 5 Oct 2011 00:28:51 -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 39389-04 for ; Wed, 5 Oct 2011 03:28:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from lists.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id EBFB1B5DBC0 for ; Wed, 5 Oct 2011 00:28:43 -0300 (ADT) Received: from perhan.alvh.no-ip.org (spinlock.commandprompt.com.commandprompt.com [207.173.203.215]) by lists.commandprompt.com (Postfix) with ESMTPA id CCC6734C39D; Tue, 4 Oct 2011 20:28:40 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([200.126.68.131] helo=perhan.alvh.no-ip.org) by assp.commandprompt.com with ESMTP (2.0.1); 4 Oct 2011 20:28:37 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 725E56E36E; Wed, 5 Oct 2011 00:28:36 -0300 (CLST) Content-Type: text/plain; charset=UTF-8 Cc: Pavel Holec , 'Craig Ringer' , Pg Bugs Subject: Re: BUG #6233: pg_dump hangs with Access Violation C0000005 From: Alvaro Herrera To: Tom Lane In-reply-to: <6027.1317776669@sss.pgh.pa.us> References: <201109282118.p8SLIwYx099581@wwwmaster.postgresql.org> <4E8422B0.5060404@ringerc.id.au> <4E8A72E3.9080701@ringerc.id.au> <6027.1317776669@sss.pgh.pa.us> Date: Wed, 05 Oct 2011 00:28:36 -0300 Message-Id: <1317784584-sup-6771@alvh.no-ip.org> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Assp-Version: 2.0.1(3.2.15) on assp.commandprompt.com X-Assp-Client-TLS: yes X-Assp-ID: assp.commandprompt.com m1-85320-11731 X-Assp-Original-Subject: Re: [BUGS] BUG #6233: pg_dump hangs with Access Violation C0000005 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201110/37 X-Sequence-Number: 31307 Excerpts from Tom Lane's message of mar oct 04 22:04:29 -0300 2011: > "Pavel Holec" writes: > > In the meantime I tried debug in msvc2005 (Win7/32) and > > free(funcsig); in pg_dump.c line 7510 cause > > _ASSERTE(_CrtIsValidHeapPointer(pUserData)); in dbgheap.c line 1252 > > * If this ASSERT fails, a bad pointer has been passed in. It may be > > * totally bogus, or it may have been allocated from another heap. > > * The pointer MUST come from the 'local' heap. > > > If I comment free(funcsig); and next one free(funcsig_tag); pg_dump works fine. > > 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...) > > However, the flaw in that explanation is that it would basically mean > pg_dump doesn't work at all on Windows, at least not if you have any > user-defined functions, and probably some other cases too because there > seem to be multiple instances of the dubious coding. It's a bit hard to > believe that nobody's noticed that before. Isn't this the kind of thing that you have to enable explicitly? It's something like this, no? http://msdn.microsoft.com/en-us/library/ff542911(v=VS.85).aspx -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support