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 1lS2An-0000gL-29 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Apr 2021 18:36:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lS2Al-0002H7-53 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Apr 2021 18:36:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lS2Ak-0002EL-Um for pgsql-hackers@lists.postgresql.org; Thu, 01 Apr 2021 18:36:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lS2Ai-0004Uk-Qy for pgsql-hackers@lists.postgresql.org; Thu, 01 Apr 2021 18:36:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 131IZso33458959; Thu, 1 Apr 2021 14:35:55 -0400 From: Tom Lane To: "'alvherre@alvh.no-ip.org'" 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 In-reply-to: <3455705.1617299197@sss.pgh.pa.us> References: <20210401161041.GA10892@alvherre.pgsql> <3455705.1617299197@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 01 Apr 2021 13:46:37 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3458957.1617302154.1@sss.pgh.pa.us> Date: Thu, 01 Apr 2021 14:35:54 -0400 Message-ID: <3458958.1617302154@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk So drongo is still failing, and after a bit of looking around at other code I finally got hit with the clue hammer. Per port.h: * On Windows, setvbuf() does not support _IOLBF mode, and interprets that * as _IOFBF. To add insult to injury, setvbuf(file, NULL, _IOFBF, 0) * crashes outright if "parameter validation" is enabled. Therefore, in * places where we'd like to select line-buffered mode, we fall back to * unbuffered mode instead on Windows. Always use PG_IOLBF not _IOLBF * directly in order to implement this behavior. You want to do the honors? And do something about that shift bug while at it. regards, tom lane