pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Benjamin Wassermann <benny@hegne.de>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #8461: PostgreSQL 9.3 pg_dump heap corruptions
Date: Mon, 14 Oct 2013 05:31:46 -0700 (PDT)
Message-ID: <1381753906060-5774487.post@n5.nabble.com> (raw)
In-Reply-To: <E1VMEdk-00031c-R3@wrigleys.postgresql.org>
References: <E1VMEdk-00031c-R3@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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-tp5771445p5...
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



view thread (5+ messages)  latest in thread

Message-ID: <1381753906060-5774487.post@n5.nabble.com>
Permalink:  ../1381753906060-5774487.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1381753906060-5774487.post@n5.nabble.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: benny@hegne.de
  Subject: Re: BUG #8461: PostgreSQL 9.3 pg_dump heap corruptions
  In-Reply-To: <1381753906060-5774487.post@n5.nabble.com>
  References: <E1VMEdk-00031c-R3@wrigleys.postgresql.org> <1381753906060-5774487.post@n5.nabble.com>

* 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