Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ipzut-0002Vb-V7 for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jan 2020 19:25:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ipzus-0001HT-Jg for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jan 2020 19:25:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ipzus-0001HM-7b for pgsql-hackers@lists.postgresql.org; Fri, 10 Jan 2020 19:25:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ipzup-0004hg-KO for pgsql-hackers@lists.postgresql.org; Fri, 10 Jan 2020 19:25:53 +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 00AJPMvC016363; Fri, 10 Jan 2020 14:25:23 -0500 From: Tom Lane To: Peter cc: pgsql-hackers@lists.postgresql.org, Stephen Frost Subject: Re: 12.1 not useable: clientlib fails after a dozen queries (GSSAPI ?) In-reply-to: <12348.1578679149@sss.pgh.pa.us> References: <20200109181822.GA74698@gate.oper.dinoex.org> <7042.1578595681@sss.pgh.pa.us> <20200109205319.GA85142@gate.oper.dinoex.org> <15232.1578605504@sss.pgh.pa.us> <20200110022342.GA92515@gate.oper.dinoex.org> <12348.1578679149@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 10 Jan 2020 12:59:09 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16361.1578684322.1@sss.pgh.pa.us> Date: Fri, 10 Jan 2020 14:25:22 -0500 Message-ID: <16362.1578684322@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > I haven't run it further to ground than that, but there's definitely > something fishy here. Based on just these results one would be hard > pressed to say if it's our bug or FreeBSD's, but your report that you > don't see the failure with PG 11 makes it sound like our problem. Ah, I have it: whoever wrote pg_GSS_read() failed to pay attention to the fact that setting errno is a critical part of its API. Sometimes it returns -1 while leaving errno in a state that causes pqReadData to draw the wrong conclusions. In particular that can happen when it reads an incomplete packet, and that's very timing dependent, which is why this is so ticklish to reproduce. I'll have a patch in a little while. regards, tom lane