pg_dump fails to dump database - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject pg_dump fails to dump database
Date
Msg-id 200012171109.eBHB9mw44598@hub.org
Whole thread Raw
Responses Re: pg_dump fails to dump database  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Mirek Hankus (M.Hankus@ce3.pl) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
pg_dump fails to dump database

Long Description
pg_dump in postgreSQL 7.0.3 fails to dump database. Problem is becomeUser procedure in which lastusername stores
pointerto name of username which is currently connected. becomeUser is called for the first time in dumpSchema, which
allocatedmemory, calls becomeUser and then frees memory. Then becomeUser is called again during dumping of table data,
butlastusername points to deallocated memory, so it receives SIGSEGV (in strcmp).  

Solution.

   Use strdup to copy username, and do not use pointer to memory allocated in other procedures

In my case this bug made it imposible to backup database, upgrade also will be imposible.

Sample Code


No file was uploaded with this report

pgsql-bugs by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: Table name scope (was Re: Outer joins aren't working with views)
Next
From: Tom Lane
Date:
Subject: Re: pg_dump fails to dump database