From owner-freebsd-bugs@FreeBSD.ORG Sun Apr 10 13:50:13 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8E56106566B for ; Sun, 10 Apr 2011 13:50:13 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A74468FC0A for ; Sun, 10 Apr 2011 13:50:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p3ADoDMo026800 for ; Sun, 10 Apr 2011 13:50:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p3ADoD6f026799; Sun, 10 Apr 2011 13:50:13 GMT (envelope-from gnats) Date: Sun, 10 Apr 2011 13:50:13 GMT Message-Id: <201104101350.p3ADoD6f026799@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Mikolaj Golub Cc: Subject: Re: kern/154504: [libc] recv(2): PF_LOCAL stream connection is stuck in sbwait when recv(MSG_WAITALL) is used X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mikolaj Golub List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2011 13:50:13 -0000 The following reply was made to PR kern/154504; it has been noted by GNATS. From: Mikolaj Golub To: Andrey Simonenko Cc: bug-followup@FreeBSD.org, freebsd-net@freebsd.org, Pawel Jakub Dawidek , Kostik Belousov Subject: Re: kern/154504: [libc] recv(2): PF_LOCAL stream connection is stuck in sbwait when recv(MSG_WAITALL) is used Date: Sun, 10 Apr 2011 16:49:25 +0300 --=-=-= Hi, Does the attached patch fix the problem for you? -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=uipc_socket.c.soreceive.patch Index: sys/kern/uipc_socket.c =================================================================== --- sys/kern/uipc_socket.c (revision 220485) +++ sys/kern/uipc_socket.c (working copy) @@ -1845,10 +1845,16 @@ dontblock: } SBLASTRECORDCHK(&so->so_rcv); SBLASTMBUFCHK(&so->so_rcv); - error = sbwait(&so->so_rcv); - if (error) { - SOCKBUF_UNLOCK(&so->so_rcv); - goto release; + /* + * We could receive some data while was notifying the + * the protocol. Skip blocking in this case. + */ + if (so->so_rcv.sb_mb == NULL) { + error = sbwait(&so->so_rcv); + if (error) { + SOCKBUF_UNLOCK(&so->so_rcv); + goto release; + } } m = so->so_rcv.sb_mb; if (m != NULL) --=-=-=--