HELP: IPC bug which crashes our 4.2 systems
jim at haring.UUCP
jim at haring.UUCP
Wed Dec 12 15:28:38 AEST 1984
There was indeed a bug in early versions of 4.2 which caused this to happen, the
problem was trying to connect to a socket where the server process exited before
accepting the connection, various parts of the uipc code assumed that another
part would tidy up partially completed connects, and looped waiting for it to
happen. Unfortunately our system has changed so much that I cannot easily make
a diff for this bug, perhaps someone else out there has it handy (it has been
discussed in unix-wizards before, about a year ago)?.
Now, I know your examples are just 'shorts' designed to show the bug, but
perhaps they can be used to show a couple of things that are not clear in
the 'IPC primer' or anywhere else for that matter:
1) for the UN*X domain you should include <sys/un.h> and use 'sockaddr_un'
instead of 'sockaddr';
2) the third argument to the 'connect' and 'bind' calls for the UN*X domain
the size of the string which is the name of the socket plus the size of
the 'sun_family' element of the 'sockaddr_un' structure, e.g.
strlen(socketname.sun_path) + sizeof(socketname.sun_family)
where 'sun_path' is the element of the 'sockaddr_un' structure which
contains the name (and is 108 characters in maximum size);
3) the server process needs to do an 'accept' call for the connection to
complete. This is, in fact why the program exhibits the panic, no accept
is done to complete the connection. This is how I found the bug a long
time ago.
Hope that helps, and also that someone can dig up the bug fix.
Good luck.
Jim McKie Centrum voor Wiskunde en Informatica, Amsterdam mcvax!jim
More information about the Comp.unix.wizards
mailing list