Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xxuap-0001zl-Bt for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Dec 2014 09:26:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xxuao-0008Bd-St for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Dec 2014 09:26:58 +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 1Xxuan-0008BV-R2 for pgsql-bugs@postgresql.org; Mon, 08 Dec 2014 09:26:57 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Xxuag-0001Rb-Mi for pgsql-bugs@postgresql.org; Mon, 08 Dec 2014 09:26:56 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 6F60028940; Mon, 8 Dec 2014 01:26:48 -0800 (PST) Received: from EX13-CAS-002.vmware.com (EX13-CAS-002.vmware.com [10.113.191.52]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 6ABBE18AE6; Mon, 8 Dec 2014 01:26:48 -0800 (PST) Received: from EX13-MBX-024.vmware.com (10.113.191.44) by EX13-MBX-005.vmware.com (10.113.191.25) with Microsoft SMTP Server (TLS) id 15.0.913.22; Mon, 8 Dec 2014 01:26:42 -0800 Received: from [192.168.1.90] (10.113.160.246) by EX13-MBX-024.vmware.com (10.113.191.44) with Microsoft SMTP Server (TLS) id 15.0.913.22; Mon, 8 Dec 2014 01:26:29 -0800 Message-ID: <54856EAB.9010407@vmware.com> Date: Mon, 8 Dec 2014 11:26:03 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-Version: 1.0 To: Justin Pryzby , Subject: Re: pg_restore crashes passing NULL to strcmp (9.4 rc1) References: <20141206061151.GA725@telsasoft.com> In-Reply-To: <20141206061151.GA725@telsasoft.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.113.160.246] X-ClientProxiedBy: EX13-CAS-013.vmware.com (10.113.191.65) To EX13-MBX-024.vmware.com (10.113.191.44) X-Pg-Spam-Score: -6.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 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. > > $ dpkg-query -W postgresql-client-9.4 > postgresql-client-9.4 9.4~rc1-1 > > (gdb) r > Starting program: /usr/lib/postgresql/9.4/bin/pg_restore /home/pryzbyj/clientdb/ptci.d/ptci.segv > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". > > Program received signal SIGSEGV, Segmentation fault. > ReadToc (AH=AH@entry=0x55555577b3b0) > at /build/buildd/postgresql-9.4-9.4~rc1/build/../src/bin/pg_dump/pg_backup_archiver.c:2426 > 2426 /build/buildd/postgresql-9.4-9.4~rc1/build/../src/bin/pg_dump/pg_backup_archiver.c: No such file or directory. > > 2422 te->owner = ReadStr(AH); > 2423 if (AH->version >= K_VERS_1_9) > 2424 { > 2425 if (strcmp(ReadStr(AH), "true") == 0) > 2426 te->withOids = true; > 2427 else > 2428 te->withOids = false; > 2429 } > 2430 else > 2431 te->withOids = true; Hmm. It's a bit hard to believe that the "te->withOids = true" assignment could've segfaulted. So the line number probably isn't 100% accurate. 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. > (gdb) p ReadStr(AH) > $1 = 0x0 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. - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs