Re: SIGIO broken in 2.2 on unix domain socket close

phazer (phazer@battlemech.darpa.org)
Sun, 4 Jul 1999 12:24:51 -0400 (EDT)


On Sun, 4 Jul 1999, Malcolm Beattie wrote:

>Async I/O via SIGIO is broken in 2.2.5 when a Unix domain peer
>socket is released. Here's a test program which works in 2.0.36
>(i.e. displays "in io_handle") but not in 2.2.5 (I don't have any
>later 2.2.x kernels to try or look at).
>
>--------------------------- cut here ---------------------------
<snip test program>
>--------------------------- cut here ---------------------------

[phazer@battlemech phazer]$ uname -a
Linux battlemech.00609782d849.ne.mediaone.net 2.2.9 #1 Tue Jun 1 19:07:26
EDT 1999 i586 unknown

[phazer@battlemech phazer]$ ./test
in io_handle

it works on my machine (kernel 2.2.10) ;)

-phazer

>
>(Obviously in the real program, the socketpair is shared between
>a parent and child process but the behaviour is the same.)
>
>The Unix domain socket stuff has been rewritten between 2.0 and
>2.2 and it looks as though maybe something like a sock_wake_async()
>has been missed out from net/unix/af_unix.c in somewhere like:
>
> skpair=unix_peer(sk);
>
> if (skpair!=NULL)
> {
> if (sk->type==SOCK_STREAM && unix_our_peer(sk, skpair))
> {
> skpair->state_change(skpair);
> skpair->shutdown=SHUTDOWN_MASK; /* No more writes*/
> }
> unix_unlock(skpair); /* It may now die */
> }
>
>Either after the state_change method gets called (or within the
>state_change) there perhaps ought to be a sock_wake_async to prod
>the peer?
>
>--Malcolm
>
>--
>Malcolm Beattie <mbeattie@sable.ox.ac.uk>
>Unix Systems Programmer
>Oxford University Computing Services
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.rutgers.edu
>Please read the FAQ at http://www.tux.org/lkml/
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/