[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Application launching and pasteboard slow down

From: Richard Frith-Macdonald
Subject: Re: Application launching and pasteboard slow down
Date: Tue, 16 Apr 2002 20:29:16 +0100

On Monday, April 15, 2002, at 10:53 PM, Richard Frith-Macdonald wrote:

On Monday, April 15, 2002, at 08:24 PM, Chris B. Vetter wrote:

gdomap is launched as

  PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$");


  ${GNUSTEP_SYSTEM_ROOT}/Tools/ix86/freebsd/gdomap -a ${IFFILE}
This is not the flag to run with probing disabled, it's the one
to specify the local IP address(es) on machines with broken
networking which doesn't support interrogation of the network

I notice you are running on freebsd. I have heard of a version of
freebsd where the networking was broken so that you couldn't detect
that a port was in use by trying to bind to it.  This would cause
multiple copies of the servers to run, because the O/S would tell
gdomap that the old copies had died when they hadn't.

The person who had that problem fixed it by changing to another
version of the operating system where the networking was not broken.

If you want to stick with the broken O/S, you can work-around this
problem by commenting out the lines setting SO_REUSEADDR in the
GNUstep networking code.  The only drawback of this is that, if
a server is shut down, it will take a few minutes before the ip
code in the kernel will let it be restarted on the same port -
this is not usually a difficulty.

I have added an autoconf check for the SO_REUSEADDR bug in the base library, and modified the networking code to use the simple workaround of not using SO_REUSEADDR on systems where it is broken (windoze, some FreeBSDs, and some
versions of Solaris AFAIK).

Explanation of the bug ... the SO_REUSEADDR option is set on a network socket to say that, if the socket is in a TIME_WAIT state (ie it has recently been closed, but the handshake for the close with the other end of the socket has not been completed) then the socket address/port may be re-used immediately. This permits a service to be restarted on the same address/port without having
to wait for the (typically 1 to 4 minute) timeout.

On some systems (windoze, some versions of FreeBSD, some of Solaris, and perhaps a few others), using SO_REUSEADDR actually permits the address/port to be re-used
This has two effects -
1. a security issue - since other processes can bind to the same address
as your process and steal packets.
2. more importantly for us, we can't attempt to bind to an address/port in order to find out if there is already a process using it - our bind attempt will succeed when it really shouldn't. This means that you can start multiple copies of servers using the same name ... since the nameserver process will
always think that the old server has died.

Not using SO_REUSEADDR  will leave most networking unaffected, but if a
gdomap process is killed, it will not be able to restart until the system
timeout has expired.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]