Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1afbnK-00052J-UA for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Mar 2016 23:21:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1afbnK-0004ED-Dj for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Mar 2016 23:21:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1afbnI-0004DL-Qn for pgsql-hackers@postgresql.org; Mon, 14 Mar 2016 23:21:00 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1afbnA-00027X-RB for pgsql-hackers@postgresql.org; Mon, 14 Mar 2016 23:20:58 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id C3FD2C049E1C; Mon, 14 Mar 2016 23:20:51 +0000 (UTC) Received: from localhost (vpn-231-95.phx2.redhat.com [10.3.231.95]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2ENKp35008918; Mon, 14 Mar 2016 19:20:51 -0400 From: Robbie Harwood To: David Steele , pgsql-hackers@postgresql.org Cc: Michael Paquier Subject: Re: [PATCH v6] GSSAPI encryption support In-Reply-To: <56E71B7C.6050108@pgmasters.net> References: <56E05575.9060200@pgmasters.net> <56E71B7C.6050108@pgmasters.net> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Mon, 14 Mar 2016 19:20:47 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable David Steele writes: > On 3/14/16 4:10 PM, Robbie Harwood wrote: > >> David Steele writes: >> >>> On 3/8/16 5:44 PM, Robbie Harwood wrote: >>> >>>> Here's yet another version of GSSAPI encryption support. It's also >>>> available for viewing on my github: >>> >>> psql simply hangs and never returns. I have attached a pcap of the >>> psql/postgres session generated with: >>=20 >> Please disregard my other email. I think I've found the issue; will >> post a new version in a moment. > > Strange timing since I was just testing this. Here's what I got: > > $ pg/bin/psql -h localhost -U vagrant@PGMASTERS.NET postgres > conn->inStart =3D 179, conn->inEnd =3D 179, conn->inCursor =3D 179 > psql (9.6devel) > Type "help" for help. > > postgres=3D> Thanks, that certainly is interesting! I did finally manage to reproduce the issue on my end, but the rate of incidence is much lower than what you and Michael were seeing: I have to run connections in a loop for about 10-20 minutes before it makes itself apparent (and no, it's not due to entropy). Apparently I just wasn't patient enough. > This was after commenting out: > > // appendBinaryPQExpBuffer(&conn->gwritebuf, > // conn->inBuffer + conn->inStart, > // conn->inEnd - conn->inStart); > // conn->inEnd =3D conn->inStart; > > The good news I can log on every time now! Since conn->inStart =3D=3D conn->inEnd in the case you were testing, the lines you commented out would have been a no-op anyway (that's the normal case of operation, as far as I can tell). That said, the chances of hitting the race for me seemed very dependent on how much code wants to run in that conditional: I got it up to 30-40 minutes when I added a lot of printf()s (can't just run in gdb because it's nondeterministic and rr has flushing bugs at the moment). All that is to say: thank you very much for investigating that! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW50dRAAoJECUy+RdqlaRCM9AQAJMJcvVJlt7XSdhTn12gBjrN tSN4elunfuBPMXTx0fXTVVIW2AfLyY5sOPKfXRjEJn9WsLxiaWQ2jO4I9V1VYfgb Mi+AQKvx/sV16bvZmFS5FHvRrrVK8EAGhsY8qMkjizSla8/S0J9QqNKJXF+PZFL1 VaLbmPLjfb+gDko0H9I3OoFBvuIYDZm4o2g9Izf3/W99MaSo7M4+JSfMalc7XQoM HcxNVo+usOl9tYEt0l1wus1C3SOlF6NrkWhPm/8Fabbw1E5tlHFSgNuOBKjRVNNe vFNdAPrydBntOWmMJPjwQL0iF1OyNnuPU/B0iD7ZOKjcYj4K9UwGJfGso1gW3/A6 WnR4UBBuaeg1hc1vwrGfSqvZFqi9tvN1QCHFZC9uGIoG7k2Z88JX/HONevwcO2P9 o8OAdiZACIlPfgFzLl2ZbtJ4PPZI6Zdg36u2XTzN6xELAhpp2nSlsGHeabg77kfR STMFRx52LHjuNF8xw1tWmV+7PmMpWLYiEcQE9Vll3KnorMy7c0ombY5xmANnKsiV eBT02pKjUKnJxhsqGZsxm4f7DMURf5X9gpQmtXOktbxPpvMemCeppumBFQjdWfMN R/+T4A2seqMOmacVyYsa5yRtJ43mw85CcgU6fnAAbdgl5PV6rm+nBgc6cqqDWa/P v8yTdpAkPp7myW9Xg7N/ =ODH5 -----END PGP SIGNATURE----- --=-=-=--