Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VVhJQ-0001S6-Dg for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Oct 2013 12:31:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VVhJP-0001fD-Pr for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Oct 2013 12:31:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VVhJO-0001dh-0N for pgsql-bugs@postgresql.org; Mon, 14 Oct 2013 12:31:50 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VVhJL-0004Yb-0k for pgsql-bugs@postgresql.org; Mon, 14 Oct 2013 12:31:49 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VVhJK-0002xT-2n for pgsql-bugs@postgresql.org; Mon, 14 Oct 2013 05:31:46 -0700 Date: Mon, 14 Oct 2013 05:31:46 -0700 (PDT) From: Benjamin Wassermann To: pgsql-bugs@postgresql.org Message-ID: <1381753906060-5774487.post@n5.nabble.com> In-Reply-To: References: Subject: Re: BUG #8461: PostgreSQL 9.3 pg_dump heap corruptions MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org We finally find out why this problem occurs. PG_dump use some Functions like initPQExpBuffer(..) from the libpq.dll. In this function "initPQExpBuffer(...)" are some memory allocated with malloc(...). (File: "pg_dump.c", line 9366) After the function is successfully dumped to backup file, there is a "free(...)" in Function "dumpFunc" at line 9942 ff. ... free(funcsig); ... but the PG_dump.exe cant free memory which is allocated by libpq.dll. To fix this problem the "libpq.dll" need a new function named "deletePQCharPointer()" File: "pqexpbuffer.h" Line: 188 > extern void deletePQCharPointer(char *pointer); The definition of the function is: File: "pqexpbuffer.c" Line: 378 > void > deletePQCharPointer(char *pointer) > { > if (pointer) > { > free(pointer); > } > } Then add the function to the exported functions in the def files File: "libpqddll.def" Line: 169 > deletePQCharPointer @ 166 File: "blibpqdll.def" Line: 169 > _deletePQCharPointer @ 166 File: "blibpqdll.def" Line: 337 > deletePQCharPointer = _deletePQCharPointer We have successfully tested the new function and it would be nice if this is in a future release of postgresql ;) Regards Ben -- View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-8461-PostgreSQL-9-3-pg-dump-heap-corruptions-tp5771445p5774487.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs