Re: BUG #8461: PostgreSQL 9.3 pg_dump heap corruptions

Поиск
Список
Период
Сортировка
От Benjamin Wassermann
Тема Re: BUG #8461: PostgreSQL 9.3 pg_dump heap corruptions
Дата
Msg-id 1381753906060-5774487.post@n5.nabble.com
обсуждение исходный текст
Ответ на BUG #8461: PostgreSQL 9.3 pg_dump heap corruptions  (benny@hegne.de)
Ответы Re: BUG #8461: PostgreSQL 9.3 pg_dump heap corruptions  (Marko Tiikkaja <marko@joh.to>)
Re: BUG #8461: PostgreSQL 9.3 pg_dump heap corruptions  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-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-tp5771445p5774487.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: BUG #8515: Random 'relation "..." does not exist'
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: BUG #8461: PostgreSQL 9.3 pg_dump heap corruptions