Re: pg_dump 9.1.1 hanging (collectSecLabels gets 0 labels)

From: Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump 9.1.1 hanging (collectSecLabels gets 0 labels)
Date: 2011-11-10 18:13:10
Message-ID: 4EBC1436.20105@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11-11-09 06:35 PM, Tom Lane wrote:
> Steve Singer<ssinger(at)ca(dot)afilias(dot)info> writes:
>> I've tracked the issue down to collectSecLabels in pg_dump.c
>
>> SELECT label, provider, classoid, objoid, objsbid FROM
>> pg_catalog.pg_seclabel;
>
>> returns 0 rows.
>
>> The code in collectSecLabels() is not prepared to deal with a zero row
>> result and tries to malloc 0 bytes.
>
> pg_seclabel is almost always empty, so I'm not convinced that you've
> identified your problem correctly.
>
> regards, tom lane
>

The attached patch seems to fix the issue.

The man page for malloc on AIX is pretty clear on what happens when you
try to malloc 0 bytes. It returns NULL.

Attachment Content-Type Size
pgdump_seclabel.diff text/x-patch 2.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Scott Mead 2011-11-10 18:26:37 Re: IDLE in transaction introspection
Previous Message Bruce Momjian 2011-11-10 18:06:41 Re: warning in pg_upgrade