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 1lRj1n-0000lH-3k for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Mar 2021 22:09:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lRj1m-0007ZS-1q for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Mar 2021 22:09:30 +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 1lRj1l-0007ZL-Rk for pgsql-hackers@lists.postgresql.org; Wed, 31 Mar 2021 22:09:29 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRj1j-0006ka-N0 for pgsql-hackers@lists.postgresql.org; Wed, 31 Mar 2021 22:09:29 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id D2F681EAC; Wed, 31 Mar 2021 18:09:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 31 Mar 2021 18:09:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=NYLHnTtxUVGq/FuuEa7ueLRduJM6vCF865UXgN2SmyQ=; b=Fb3joH5D QtZvkird72pSuxCCZrF/CpYVYSKHAHUQc83lNJWwfkAO29JYwyRltN4V50b5w40d 26N0uRCkN0v/mDbyw0AyD22qMuSqx6HNZI64FY0ttzPmK8wMEzwqw4f6kFIvQrmS U6X+NcZaeVZkIRPHpAvATlCf6fsRq+KLIh4uXBMHuI0kBhaIEpNqf3HuvGwP0/ia QBD6p9wy8PYatQ8q10BqRpT7VnRbOnTOgfxOX2wZXqWqLM1ZRTtprWmJf8XhlM4E kXkAamJ+h9l+BN2RxxIztIqkGxm48Hhyd38d70q7gTcm65fp4e6t5F5TJtxrkp2Z XmZ9DzQB2/BOrg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeifedgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoteeftdelqddtudculddvtddmnecujfgurhepff fhvffukfggtggugfgjfgesmhekreertderudenucfhrhhomhepfddkrghlvhhhvghrrhgv segrlhhvhhdrnhhoqdhiphdrohhrghdkfdcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnoh dqihhprdhorhhgqeenucggtffrrghtthgvrhhnpeevgeejfeettdelffevleffleehkefg fedutedvheejieetieehleelhfefveetgfenucfkphepudeltddrleehrdduledrleehne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id 74DEE24005E; Wed, 31 Mar 2021 18:09:23 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 8838D2A0CAD; Wed, 31 Mar 2021 19:09:20 -0300 (-03) Date: Wed, 31 Mar 2021 19:09:20 -0300 From: "'alvherre@alvh.no-ip.org'" To: Tom Lane Cc: "iwata.aya@fujitsu.com" , "tsunakawa.takay@fujitsu.com" , 'Kyotaro Horiguchi' , "k.jamison@fujitsu.com" , "pgsql-hackers@lists.postgresql.org" Subject: Re: libpq debug log Message-ID: <20210331220920.GA23882@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="gKMricLos+KVdGMg" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3333908.1617227066@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --gKMricLos+KVdGMg Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2021-Mar-31, Tom Lane wrote: > I wrote: > > That is weird - only test 4 (of 8) runs at all, the rest seem to > > fail to connect. What's different about pipelined_insert? > > Oh ... there's a pretty obvious theory. pipelined_insert is > the only one that is not asked to write a trace file. > So for some reason, opening the trace file fails. > (I wonder why we don't see an error message for this though.) .. oh, I think we forgot to set conn->Pfdebug = NULL when creating the connection. So when we do PQtrace(), the first thing it does is PQuntrace(), and then that tries to do fflush(conn->Pfdebug) ---> crash. So this should fix it. -- Álvaro Herrera Valdivia, Chile really, I see PHP as like a strange amalgamation of C, Perl, Shell inflex: you know that "amalgam" means "mixture with mercury", more or less, right? i.e., "deadly poison" --gKMricLos+KVdGMg Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="initialize.patch" diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index a90bdb8ab6..56a8266bc3 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -3952,6 +3952,7 @@ makeEmptyPGconn(void) conn->verbosity = PQERRORS_DEFAULT; conn->show_context = PQSHOW_CONTEXT_ERRORS; conn->sock = PGINVALID_SOCKET; + conn->Pfdebug = NULL; /* * We try to send at least 8K at a time, which is the usual size of pipe --gKMricLos+KVdGMg--