From owner-freebsd-current@FreeBSD.ORG Tue Sep 18 01:52:35 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEE7616A418 for ; Tue, 18 Sep 2007 01:52:35 +0000 (UTC) (envelope-from dengxf@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8457A13C48A for ; Tue, 18 Sep 2007 01:52:35 +0000 (UTC) (envelope-from dengxf@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so2215021waf for ; Mon, 17 Sep 2007 18:52:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:from:to:subject:message-id:mime-version:content-type:content-transfer-encoding:x-mailer; bh=P+ea6lxOAtaCeuL8qSTcIEhzH17YX3FZbStI/xsFncc=; b=HUd8Lj+/RL1rAkidXlBdgS86sUn5wxwdZMC+WbsI2J3yQRXhpPpgO5jPFWnKBpihze5U9p4ho9TZ+OJXBK3f3aMPm1Z2AzB2t7+WZ/1pWt1lXzgnRkhcdyuR99AIZIVCRbJqj/+FvwUdbjHcrYDFmAwqRH5kSvEhZQf/871U17Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:subject:message-id:mime-version:content-type:content-transfer-encoding:x-mailer; b=T0an3ShcxozXM8r/NSl7XbbWAamQdFCfpg+9wavLOBMUWSyppcuoOt+aiZidiJsOMraRw7tjt8OklfIf4UV4QatagigKmQOfV75H29nCZAWUccPP47N6dv8za9jOBYM2VR0KnutTHNDiKXSXSsPPOlMa3mGKTMf/m5eYWqM29XU= Received: by 10.114.78.1 with SMTP id a1mr2201900wab.1190080354531; Mon, 17 Sep 2007 18:52:34 -0700 (PDT) Received: from ?127.0.0.1? ( [218.94.128.114]) by mx.google.com with ESMTPS id j15sm5433494waf.2007.09.17.18.52.29 (version=SSLv3 cipher=RC4-MD5); Mon, 17 Sep 2007 18:52:32 -0700 (PDT) Date: Tue, 18 Sep 2007 09:52:31 +0800 From: Deng XueFeng To: freebsd-current@freebsd.org, peterjeremy@optushome.com.au Message-Id: <20070918095036.1B14.DENGXF@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------_46EF2EEC1B12036963D0_MULTIPART_MIXED_" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.31 [CN] X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Fw: Re: using unix domain socket get ENOTCONN in both 6.2 and 7.0 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2007 01:52:36 -0000 --------_46EF2EEC1B12036963D0_MULTIPART_MIXED_ Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable forgot cc.... =D3=C9 Deng XueFeng =D7=AA=B7=A2=A3=BA ----------------------- =D4=AD=D3=CA=BC=FE=C6=F0=CA=BC=CE=BB --------------= --------- From: "Deng XueFeng" To: "Peter Jeremy" Date: Mon, 17 Sep 2007 21:06:33 +0800 Subject: Re: using unix domain socket get ENOTCONN in both 6.2 and 7.0 ---- yes, i do not chech anything, because i want create a race between close(2) and write(2) int the parent process, the write(2) should not return ENOTCONN. in 2005, there was one like this: http://lists.freebsd.org/pipermail/freebsd-bugs/2005-March/012123.html 2007/9/17, Peter Jeremy : > > On 2007-Sep-17 16:12:41 +0800, Deng XueFeng wrote: > >then I write a test program, and can reproduce in 6.2 and 7.0 > > Read() and write() do not preserve message boundaries so you cannot > guarantee to read 8193 bytes just because you wrote 8193 bytes. > > >#./ud_test > >child recv len [4992] failed: Unknown error: 0 > > This is an error in your program: The read() succeeded and returned > 4992 bytes. The child then exits > > >main send len [-1] failed: Socket is not connected > > Which leaves the socket unconnected so the parent (correctly) receives > an error. > > -- > Peter Jeremy > > --------------------- =D4=AD=D3=CA=BC=FE=BD=E1=CA=F8=CE=BB ----------------= ---- --=20 Deng XueFeng --------_46EF2EEC1B12036963D0_MULTIPART_MIXED_ Content-Disposition: attachment; filename=forward.html Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" yes, i do not chech anything, because i want create a race between close(2) and write(2) int the parent process, the write(2) should not return ENOTCONN. in 2005, there was one like this: [1]http://lists.freebsd.org/pipermail/freebsd-bugs/2005-March/012123.h tml 2007/9/17, Peter Jeremy <[2]peterjeremy@optushome.com.au>: On 2007-Sep-17 16:12:41 +0800, Deng XueFeng <[3]dengxf@gmail.com> wrote: >then I write a test program, and can reproduce in 6.2 and 7.0 Read() and write() do not preserve message boundaries so you cannot guarantee to read 8193 bytes just because you wrote 8193 bytes. >#./ud_test >child recv len [4992] failed: Unknown error: 0 This is an error in your program: The read() succeeded and returned 4992 bytes. The child then exits >main send len [-1] failed: Socket is not connected Which leaves the socket unconnected so the parent (correctly) receives an error. -- Peter Jeremy References 1. http://lists.freebsd.org/pipermail/freebsd-bugs/2005-March/012123.html 2. mailto:peterjeremy@optushome.com.au 3. mailto:dengxf@gmail.com --------_46EF2EEC1B12036963D0_MULTIPART_MIXED_--