Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XxzhP-0005Er-KB for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Dec 2014 14:54:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XxzhP-00036F-3P for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Dec 2014 14:54:07 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XxzhN-00033c-IC for pgsql-bugs@postgresql.org; Mon, 08 Dec 2014 14:54:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XxzhK-0007OA-CP for pgsql-bugs@postgresql.org; Mon, 08 Dec 2014 14:54:03 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sB8Es0n0024600; Mon, 8 Dec 2014 09:54:00 -0500 From: Tom Lane To: Heikki Linnakangas cc: Justin Pryzby , pgsql-bugs@postgresql.org Subject: Re: pg_restore crashes passing NULL to strcmp (9.4 rc1) In-reply-to: <54856EAB.9010407@vmware.com> References: <20141206061151.GA725@telsasoft.com> <54856EAB.9010407@vmware.com> Comments: In-reply-to Heikki Linnakangas message dated "Mon, 08 Dec 2014 11:26:03 +0200" Date: Mon, 08 Dec 2014 09:54:00 -0500 Message-ID: <24599.1418050440@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Heikki Linnakangas 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