Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0BDW-0002RC-Ct for pgsql-committers@arkaria.postgresql.org; Sun, 25 Mar 2018 19:22:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f0BDU-0003vr-Gj for pgsql-committers@arkaria.postgresql.org; Sun, 25 Mar 2018 19:22:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0BDU-0003vi-BO for pgsql-committers@lists.postgresql.org; Sun, 25 Mar 2018 19:22:08 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0BDR-0007BY-PK for pgsql-committers@lists.postgresql.org; Sun, 25 Mar 2018 19:22:07 +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 w2PJM3rE003588; Sun, 25 Mar 2018 15:22:03 -0400 From: Tom Lane To: David Steele cc: Teodor Sigaev , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Exclude unlogged tables from base backups In-reply-to: <8d57c3ba-d44b-a8eb-7a91-c0b6156240fd@pgmasters.net> References: <14453.1522001792@sss.pgh.pa.us> <8d57c3ba-d44b-a8eb-7a91-c0b6156240fd@pgmasters.net> Comments: In-reply-to David Steele message dated "Sun, 25 Mar 2018 15:10:03 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3586.1522005723.1@sss.pgh.pa.us> Date: Sun, 25 Mar 2018 15:22:03 -0400 Message-ID: <3587.1522005723@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Steele writes: > On 3/25/18 2:16 PM, Tom Lane wrote: >> Buildfarm member skink (valgrind) has reported this during its last couple >> of runs: > I think skink is using large values for rel oids and that has exposed a > bug. The strncpy doesn't zero terminate the string if the oid has the > max number of characters. At least, I was able to reproduce under those > circumstances. Actually, that code didn't guarantee zero termination under *any* circumstances; it only happened to work if the stack contained zeroes to start with. > The attached should fix it. Found this in my inbox right after pushing a fix. I did it slightly differently, emulating the later rather than earlier calls in reinit.c. The earlier ones memset the whole target field because they're concerned about being able to hash it, but we don't need that here, just zero termination. regards, tom lane