From owner-freebsd-bugs Fri Jun 4 5:30: 5 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id DB41615365 for ; Fri, 4 Jun 1999 05:30:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id FAA78876; Fri, 4 Jun 1999 05:30:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Fri, 4 Jun 1999 05:30:03 -0700 (PDT) Message-Id: <199906041230.FAA78876@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Tony Finch Subject: Re: kern/11988: recvmsg with a cmsghdr but no iovec is broken Reply-To: Tony Finch Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/11988; it has been noted by GNATS. From: Tony Finch To: Brian Somers Cc: Tony Finch , FreeBSD-gnats-submit@freebsd.org Subject: Re: kern/11988: recvmsg with a cmsghdr but no iovec is broken Date: Fri, 4 Jun 1999 13:23:29 +0100 (BST) Brian Somers writes: > > Brian Somers writes: > > > > > > One other observation (a problem I suffered with for some time); you > > > *must* have some sort of handshake to confirm that the descriptor has > > > been received. If you call close(conn) while the descriptor is still > > > in limbo (an mbuf) the descriptor will arrive at the other end ready > > > to give you EBADF next time you use it. > > > > > > A simple read(child, &ch, 1) after sendmsg() and before the close(conn) > > > and a write(3, "X", 1) after the recvmsg() will do the trick. > > > > AIUI that shouldn't be necessary: the f_count field should be > > incremented while the descriptor is in transit so close()ing it should > > not cause the resources to be released. If the receiver of the > > descriptor gets EBADF because the sender close()d it while it was in > > transit that is a bug (but a different one from the one that started > > this PR). > > I've had a poke around 'cos I recalled seeing someone else spot this. > The -current sendmsg man page mentions it in the BUGS section. -STABLE too. Do you have code to provoke it? Tony. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message