Re: pg_dump Crashes and core dumps - Mailing list pgsql-bugs

From Tom Lane
Subject Re: pg_dump Crashes and core dumps
Date
Msg-id 16927.1052000970@sss.pgh.pa.us
Whole thread Raw
In response to pg_dump Crashes and core dumps  (Shibashish <shiba@it.iitb.ac.in>)
List pgsql-bugs
Shibashish <shiba@it.iitb.ac.in> writes:
> When i do a "pg_dump test" it works fine.
> But When i do a "pg_dump working" I get "Segmentation fault (core dumped)"

Olivier Prenant just found a problem that could lead to pg_dump trouble
with any database using PL languages.  Try the attached patch and see if
it fixes your problem.

            regards, tom lane


*** src/bin/pg_dump/pg_dump.c.orig    Thu Apr 24 22:28:22 2003
--- src/bin/pg_dump/pg_dump.c    Sat May  3 18:09:51 2003
***************
*** 3591,3597 ****
          resetPQExpBuffer(delqry);

          /* Make a dependency to ensure function is dumped first */
!         deps = malloc(sizeof(char *) * (2 + (strcmp(lanvalidator, "0") != 0) ? 1 : 0));
          depIdx = 0;

          (*deps)[depIdx++] = strdup(lanplcallfoid);
--- 3591,3597 ----
          resetPQExpBuffer(delqry);

          /* Make a dependency to ensure function is dumped first */
!         deps = malloc(sizeof(char *) * 10);
          depIdx = 0;

          (*deps)[depIdx++] = strdup(lanplcallfoid);

pgsql-bugs by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Very bizarre bug with corrupted index
Next
From: Achilleus Mantzios
Date:
Subject: Wrong index usage in 7.3.2