[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#764157: lsh-utils: [kfreebsd] testsuite fails sometimes



Hi Niels,

At 10:26, Niels Möller wrote:
> Steven Chamberlain <steven@pyro.eu.org> writes:
> > https://buildd.debian.org/status/fetch.php?pkg=lsh-utils&arch=kfreebsd-i386&ver=2.1-4&stamp=1412538954
> > | Testing /«PKGBUILDDIR»/src/testsuite/rapid7-ssh-pdu/0000431.pdu
> > | tcpconnect: shutdown failed: Connection reset by peer
> > | Connect failed
> > | FAIL: rapid7-lshd

> Now, my guesss is that there's a race condition, the client (tcpconnect)
> calls shutdown on the socket after it has sent its data. If I understand
> this correctly, the server responds with a TCP reset in case that socket
> has been closed before the client's TCP fin arrives. Does that make
> sense?

Yes, probably something like that.  The FreeBSD kernel may allow
things to happen in a different order sometimes, whereas Linux may have
different locking or order of processing.

> The linux man page for shutdown(2) doesn't list ECONNRESET as a possible
> error, only ENOTCONN. So it seems bsd and linux uses different errno
> values for this TCP error case?

FreeBSD seems to use ENOTCONN only to mean "never connected" and
ECONNRESET to mean "was connected, but peer has disconnected", whereas
the shutdown code for Linux doesn't distinguish between.
 
> Can you try the below patch for tcpconnect (located in
> lsh/src/testsuite)?

Yes.  Without the patch, I could reproduce the bug 1 in 3 occasions.
With the patch it doesn't seem to happen any more.  Thanks!

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org


Reply to: