Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC840302); site haring.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!mhuxn!houxm!ihnp4!zehntel!dual!amd!pesnta!hplabs!hao!seismo!mcvax!turing!haring!jim From: jim@haring.UUCP Newsgroups: net.unix-wizards Subject: Re: HELP: IPC bug which crashes our 4.2 systems Message-ID: <374@haring.UUCP> Date: Wed, 12-Dec-84 00:28:38 EST Article-I.D.: haring.374 Posted: Wed Dec 12 00:28:38 1984 Date-Received: Fri, 7-Dec-84 05:37:05 EST References: <6271@brl-tgr.ARPA> Organization: CWI, Amsterdam Lines: 32 Apparently-To: rnews@turing.LOCAL 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 includeand 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