pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: pg_restore crashes passing NULL to strcmp (9.4 rc1)
Date: Mon, 08 Dec 2014 09:54:00 -0500
Message-ID: <24599.1418050440@sss.pgh.pa.us> (raw)
In-Reply-To: <54856EAB.9010407@vmware.com>
References: <20141206061151.GA725@telsasoft.com>
	<54856EAB.9010407@vmware.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> On 12/06/2014 08:11 AM, Justin Pryzby wrote:
>> I'm not sure what's wrong with this dump file; I remember copying it with rsync
>> some months ago, experiencing the crash, and recopying it, not able to break
>> off and go into debugging postgres at that point.

> A corrupted dump file can certainly cause a segfault in pg_restore, so 
> the dump file was probably somehow damaged while copying it with rsync. 
> Can't say more than that, I'm afraid, without the dump file itself.

Yeah, I think this sounds like "rsync screwed up".

> That tries reads the *next* string from the dump file, so it's not very 
> surprising that that fails. The previous ReadStr() call probably failed 
> already, and it would be more interesting to to see what went wrong there.

AFAICS, the only thing that would cause ReadStr to return NULL (rather
than failing internally) would be having read a negative length word
from the file.  So it's hard to come to any conclusion other than that
the file is corrupt.  There are various subcases of that but it all
comes out to the same place in the end --- especially if recopying
the original file produced a valid readable file.

Possibly this bug report should be interpreted as "we should strive
to make pg_restore yield an appropriate error message rather than ever
dumping core, no matter what's wrong with the input file".  It would not
be too hard to fix this specific case, but trying to ensure that we've
gotten rid of every other case would probably be a huge amount of work
for not much reward :-(

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (3+ messages)

Message-ID: <24599.1418050440@sss.pgh.pa.us>
Permalink:  ../24599.1418050440@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24599.1418050440@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, hlinnakangas@vmware.com, pryzby@telsasoft.com
  Subject: Re: pg_restore crashes passing NULL to strcmp (9.4 rc1)
  In-Reply-To: <24599.1418050440@sss.pgh.pa.us>
  References: <20141206061151.GA725@telsasoft.com> <54856EAB.9010407@vmware.com> <24599.1418050440@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox