Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mCCg0-0007Ki-3b for pgsql-committers@arkaria.postgresql.org; Sat, 07 Aug 2021 03:07:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mCCfx-0000n6-Pf for pgsql-committers@arkaria.postgresql.org; Sat, 07 Aug 2021 03:07:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mCCfw-0000ms-Bx for pgsql-committers@lists.postgresql.org; Sat, 07 Aug 2021 03:07:05 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mCCfq-0001Kl-Ir for pgsql-committers@lists.postgresql.org; Sat, 07 Aug 2021 03:07:03 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id AAF303200927; Fri, 6 Aug 2021 23:06:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 06 Aug 2021 23:06:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=swsY593EcTNy697dvywQIzYpin1 Zv8I2LfJDg0XiKeg=; b=QWWN+sSF3yLgJmIM9YX914UXPqkXFzw/D7SHbgOFHQa 39muG2xzA3qpTy42IEjl1tOgtFwljHX+v0iBxtQEeO/PH9gm9XObh5ufU54kL2Hg lKuhg1xNQKFfx+XSszaZmCGglBROphZu7JVCWvaRUB+bA3N5+V6Ye3QKQ/15vJBR EEUMGuRh/Hh9cMiCe1/A44SI/WYxCyoyAJXvDFISfOibhZmzgW2awMtrPPOLPDR7 ja2qFuw9RIXt3h4nnpabdGhQM1jQzK1GgIFzrZ98cPU4Bgh5fvCr90nlUPdnH/+d ArZYVRWqGlxUB2mZtHvDk9XtmUKBG2epNhSV9xw74Ow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=swsY59 3EcTNy697dvywQIzYpin1Zv8I2LfJDg0XiKeg=; b=BHJ3eJLgo36NcaeW1OVIBh /nWuGa6gEg0wMk74esE9WRPAq3NJTGy1muZd73O0R19DgzoVVF1KutoiDpc6hcIt VPSXb2qe7ZQF7VBUrcykyHpAcX0IIG9Ekk0O0krOG1+ORb3XyaU7fEeCxbIoiZW7 hovIVvo/fgLwr4q+vYopoQ69kOh0AH4tbWlLfICrzp5Ixh5kIDDnU6WaNn5qmQMD bXNQXD8CjKd4n3VUMr71lGCoEPvZb74zpl7MmRxY9V7AWzk0RuR3kZxmawkLJxjc hYShPWFKevZ1id7UQeT1uQbZ0omPr+Vv/jeA88PfIaX5Mptm/CuVFYYL/LDGfuPg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrjedvgdeivdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttdertd dttddvnecuhfhrohhmpeetnhgurhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgr rhgriigvlhdruggvqeenucggtffrrghtthgvrhhnpeetheehiefgudelhfevvddvtdejhe ehkeelteekveeggeduieelieduuefgfedtjeenucffohhmrghinhepphhoshhtghhrvghs qhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 6 Aug 2021 23:06:53 -0400 (EDT) Date: Fri, 6 Aug 2021 20:06:52 -0700 From: Andres Freund To: Tom Lane Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o Message-ID: <20210807030652.qf5wsbhxk7dpsmtn@alap3.anarazel.de> References: <2638683.1628304247@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2638683.1628304247@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-08-06 22:44:07 -0400, Tom Lane wrote: > Andres Freund writes: > > pgstat: Bring up pgstat in BaseInit() to fix uninitialized use of pgstat by AV. > > sifaka took exception to this, or at least I guess it was this one out > of the four you pushed at once: Longfin as well. It's the assertions from ee3f8d3d3ae, but possibly only exposed after fb2c5028e63. Not sure why it's your two animals that report this issue, but not others? Why would a backend doing SendBaseBackup() previously have allocated temp files? Don't get me wrong - it's good that they surfaced the issue, and it's an issue independent of the specific trigger. Glad I added the assertions... See also https://www.postgresql.org/message-id/20210803023612.iziacxk5syn2r4ut%40alap3.anarazel.de > TRAP: FailedAssertion("pgstat_is_initialized && !pgstat_is_shutdown", File: "pgstat.c", Line: 4810, PID: 74447) > 0 postgres 0x0000000100e5a520 ExceptionalCondition + 124 > 1 postgres 0x0000000100ca1dec pgstat_reset_counters + 0 > 2 postgres 0x0000000100ca2548 pgstat_report_tempfile + 80 > 3 postgres 0x0000000100d07ca4 FileClose + 536 > 4 postgres 0x0000000100d09764 CleanupTempFiles + 160 > 5 postgres 0x0000000100d0f8c0 proc_exit_prepare + 228 > 6 postgres 0x0000000100d0f79c proc_exit + 24 > 7 postgres 0x0000000100e5ae04 errfinish + 856 > 8 postgres 0x0000000100f1a804 ProcessInterrupts.cold.9 + 88 > 9 postgres 0x0000000100d36a98 ProcessInterrupts + 604 > 10 postgres 0x0000000100cd93c4 sendDir + 1516 > 11 postgres 0x0000000100cd83a0 perform_base_backup + 3592 > 12 postgres 0x0000000100cd72c0 SendBaseBackup + 256 > 13 postgres 0x0000000100ce6a48 exec_replication_command + 1852 > 14 postgres 0x0000000100d39190 PostgresMain + 3260 > 15 postgres 0x0000000100ca9c78 process_startup_packet_die + 0 > 16 postgres 0x0000000100ca94ec ClosePostmasterPorts + 0 > 17 postgres 0x0000000100ca6a0c PostmasterMain + 4584 > 18 postgres 0x0000000100c0b798 help + 0 > 19 libdyld.dylib 0x0000000184391430 start + 4 Greetings, Andres Freund