David Steele <da...@pgmasters.net> writes:

> On 3/14/16 4:10 PM, Robbie Harwood wrote:
>> David Steele <da...@pgmasters.net> 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:
>> 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 vagr...@pgmasters.net postgres
> conn->inStart = 179, conn->inEnd = 179, conn->inCursor = 179
> psql (9.6devel)
> Type "help" for help.
> postgres=>

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 = conn->inStart;
> The good news I can log on every time now!

Since conn->inStart == 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!

Attachment: signature.asc
Description: PGP signature

Reply via email to