* socket still listening after process crashes
@ 1996-06-25 4:00 ccrlphr
1996-06-27 4:00 ` Steffen Ullrich
0 siblings, 1 reply; 2+ messages in thread
From: ccrlphr @ 1996-06-25 4:00 UTC (permalink / raw)
we realized the following weird behavior on DEC UNIX 3.2C:
1. an application creates a socket, binds it and put it into LISTEN mode.
2. the application accepts various connection
3. the application crashes (for instance using kill -BUS ..). after the
application dumped the core:
- netstat shows the socket still in LISTEN mode
- a connect request on this socket from a new client gets
accepted by the system
The sockets gets only deleted after ALL clients closed the connection.
This need to be done by hand because the clients do not realize that
the connection closed (if the system does not realize this you cannot
expect it from the clients).
I don't think that this is the way it should work, so my questions:
- is there a patch available and/or is this problem solved in DEC UNIX 4.0?
- is there a workaround? (SO_REUSEADDR does not help, SO_KEEPALIVE
checks only every 2..3 hours which is not fast enough)
--
Steffen Ullrich * ccrlphr@xensei.com * http://www.xensei.com/users/ccrlphr/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: socket still listening after process crashes
1996-06-25 4:00 socket still listening after process crashes ccrlphr
@ 1996-06-27 4:00 ` Steffen Ullrich
0 siblings, 0 replies; 2+ messages in thread
From: Steffen Ullrich @ 1996-06-27 4:00 UTC (permalink / raw)
In article <4qs7r3$2ol@pt9201.ped.pto.ford.com>,
millerb@pt9536.ped.pto.ford.com (Bryan Miller) writes:
> ccrlphr@xensei.com appears to have written:
>
>>we realized the following weird behavior on DEC UNIX 3.2C:
>>1. an application creates a socket, binds it and put it into LISTEN mode.
>>2. the application accepts various connection
>>3. the application crashes (for instance using kill -BUS ..). after the
>> application dumped the core:
>
> [ snippy snip]
>
>> - is there a patch available and/or is this problem solved in DEC UNIX 4.0?
>> - is there a workaround? (SO_REUSEADDR does not help, SO_KEEPALIVE
>> checks only every 2..3 hours which is not fast enough)
>
> We are having the same problem running perl 5.001 under Digital
> Unix 3.2D-1. It usually takes 40 minutes for the connection
> to time out. Nasty when inetd or some daemon is trying to
> re-use the port. Any tips or patch numbers would be great.
>
with some help from Christoph Robitschko <chmr@freebee.tu-graz.ac.at> we
realized that the problem was caused by the fact that child processes
of the server were still alive. to get rid of this problem you should
either close the sockets you don't need (e.g. the listener) by hand after forking
or - if you make an exec after the fork (like we did) simple
fcntl(socket,F_SETFD,FD_CLOEXEC)
this will ensure that the new process will close this socket while doing "exec".
works great for us.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1996-06-27 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-06-25 4:00 socket still listening after process crashes ccrlphr
1996-06-27 4:00 ` Steffen Ullrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox