Re: 2.1.25 breaks dump

Kevin Buhr (buhr@stat.wisc.edu)
06 Feb 1997 13:09:15 -0600


The dump trouble is a symptom of a more serious problem. For example,
consider the following bit of code:

* * *

socktest.c:

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>

main()
{
int sv[2];
char buffer[256];

if(socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) {
perror("socketpair");
exit(1);
}

close(sv[0]);
if(read(sv[1],buffer,256)<0) {
perror("read");
exit(1);
}
close(sv[1]);
}

* * *

Run on 2.1.25, the read blocks (!), and even after the process is
killed, a "netstat" shows that *both* sockets are still in the
CONNECTED state!

It looks like this was introduced in Alan's "linux/net/socket.c"
patches.

Alan, I've only had time to glance at the changes, and so far I've
discovered this: (1) there's a missing "unlock_kernel" at the end of
"sys_shutdown"; (2) "sys_socketpair" doesn't seem to ever "sockfd_put"
the descriptors it "sockfd_lookup"s.

The (1)st isn't the problem, but could the (2)nd be doing it? I
haven't had time to check (or even verify if (2) is really a bug or
not).

Kevin <buhr@stat.wisc.edu>