Re: Segmentation fault: pg_upgrade 9.1 to 9.3: pg_dump: row number 0 is out of range 0..-1

From: Alan Nilsson <anilsson(at)apple(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Robert Nix <robert(at)urban4m(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault: pg_upgrade 9.1 to 9.3: pg_dump: row number 0 is out of range 0..-1
Date: 2013-10-26 06:28:11
Message-ID: 0DB543DD-20E0-4637-92BA-71195ED9755B@apple.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I ran into something tonight that seems relevant here, or certainly related:

I recently updated my app(s) libpq version from 9.1 to 9.3 and immediately I starting seeing:

row number 0 is out of range 0..-1

spewed to stdout.

I traced it down to this code:

if (PQresultStatus(result) == PGRES_TUPLES_OK){
if (!PQgetisnull(result, 0, 0)){
......
}
}

if the result contains 0 tuples, the message is spit to stdout. This is new behavior, I went back and rebuilt using lib versions (according to PQlibVersion) 90102, 90203, and 90300. Neither version 90102 & 90203 spewed to stdout.

I don't know if this is causing the OP's crash, but it seems to me that there is something going on in libpq that needs to be looked at. If nothing else than to get rid of the spewing to stdout.

alan

On Oct 10, 2013, at 9:47 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> On Sat, Sep 14, 2013 at 09:40:01PM -0400, Robert Nix wrote:
>> Running a pg_upgrade task is causing Segmentation fault:
>>
>> command: "/usr/lib/postgresql/9.3/bin/pg_dump" --host "/var/lib/postgresql"
>> --port 50432 --username "postgres" --schema-only --quote-all-identifiers
>> --binary-upgrade --format=custom --file="pg_upgrade_dump_6064585.custom" "u"
>>>> "pg_upgrade_dump_6064585.log" 2>&1
>> pg_dump: row number 0 is out of range 0..-1
>> Segmentation fault (core dumped)
>
> This error is coming from libpq, specifically
> check_tuple_field_number(), which is called by PQgetvalue(),
> PQgetlength(), and PQgetisnull(). As I have never seen this error
> before, there might be something wrong with the system catalogs on that
> cluster. It would be good to run pg_dump --binary-upgrade on that
> database and try to identify the object being dumped that is causing the
> crash.
>
> --
> Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
> EnterpriseDB http://enterprisedb.com
>
> + Everyone has their own god. +
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc Mamin 2013-10-26 07:11:33 Re: Detecting change in event properties
Previous Message Gregory Haase 2013-10-26 06:23:29 Re: PostgreSQL Point In Time Recovery