[Patch]Re: Serious reproducible 2.4.x kernel hang

From: Prasanna P Subash (psubash@turbolinux.com)
Date: Fri Feb 02 2001 - 04:25:50 EST


 
> #include <stdio.h>
> #include <unistd.h>
> #include <sys/types.h>
> #include <sys/socket.h>
>
> int
> main(int argc, const char* argv[])
> {
> int retval;
> int sockets[2];
> char buf[1];
>
> retval = socketpair(PF_UNIX, SOCK_DGRAM, 0, sockets);
> if (retval != 0)
> {
> perror("socketpair");
> exit(1);
> }
> shutdown(sockets[0], SHUT_RDWR);
> read(sockets[0], buf, 1);
> }

I tried to debug this issue with the kdb on 2.4.1-pre7.
Here is the stack trace

mcount+0x1f9
wait_for_packet+0x13
skb_recv_datagram+0xbb
unix_dgram_recvmsg+0x53
sock_recvmsg+0x41
sock_read+0x8f
sys_read+0xa4
system_call+0x3c

I looked at the skb_recv_datagram code and noticed that wait_for_packet is not
returning an error, even while trying to read a closed socket.
Anyways here is a patch against 2.4.1 that will fix the issue.
Please feel free to flame me about the patch :)

thanks

-- 
Prasanna Subash   ---   psubash@turbolinux.com   ---     TurboLinux, INC
------------------------------------------------------------------------
Linux, the choice          | Q: How do you keep a moron in suspense? 
of a GNU generation   -o)  | 
Kernel 2.2.16         /\\  | 
on a i686            _\\_v | 
                           | 
------------------------------------------------------------------------



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



This archive was generated by hypermail 2b29 : Wed Feb 07 2001 - 21:00:14 EST