Fw: Re: using unix domain socket get ENOTCONN in both 6.2 and 7.0

Deng XueFeng dengxf at gmail.com
Mon Sep 17 18:52:36 PDT 2007


forgot cc....

ÓÉ Deng XueFeng <dengxf at gmail.com> ת·¢£º
----------------------- Ô­ÓʼþÆðʼλ -----------------------
 From:    "Deng XueFeng" <dengxf at gmail.com>
 To:      "Peter Jeremy" <peterjeremy at optushome.com.au>
 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 <peterjeremy at optushome.com.au>:
>
> On 2007-Sep-17 16:12:41 +0800, Deng XueFeng <dengxf at 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
>
>

--------------------- Ô­Óʼþ½áÊøλ --------------------

-- 
Deng XueFeng <dengxf at gmail.com>
-------------- next part --------------

   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 at optushome.com.au>:

     On 2007-Sep-17 16:12:41 +0800, Deng XueFeng <[3]dengxf at 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 at optushome.com.au
   3. mailto:dengxf at gmail.com


More information about the freebsd-current mailing list