Kernel 2.6.32-5-amd64 #1 SMP Sat Oct 30 14:18:21 UTC 2010 x86_64 GNU/Linux Tor v0.2.2.23-alpha (git-b85eb949b528f4d7)
Hi folks,
on blutmagie exit Tor frequently logs Apr 04 15:27:48.706 [warn] Error binding network socket: Address already in use Apr 04 15:27:48.765 [warn] Error binding network socket: Address already in use Apr 04 15:27:48.775 [warn] Error binding network socket: Address already in use Apr 04 15:27:48.785 [warn] Error binding network socket: Address already in use Apr 04 15:27:48.864 [warn] Error binding network socket: Address already in use Apr 04 15:27:48.900 [warn] Error binding network socket: Address already in use
I'm a little bit clueless what's wrong here. I've read http://hea-www.harvard.edu/~fine/Tech/addrinuse.html and found SO_REUSEADDR being used in connection.c. Tor opens about 1k new tcp connections/s and the average number of open tcp sessions is about 70k.
anonymizer2:/tmp# netstat -tn | wc -l 70597
Any ideas why Tor can't bind to sockets?
regards Olaf
On Mon, Apr 04, 2011 at 03:37:25PM +0200, Olaf Selke wrote:
Apr 04 15:27:48.706 [warn] Error binding network socket: Address already in use
I'm a little bit clueless what's wrong here. I've read http://hea-www.harvard.edu/~fine/Tech/addrinuse.html and found SO_REUSEADDR being used in connection.c. Tor opens about 1k new tcp connections/s and the average number of open tcp sessions is about 70k.
anonymizer2:/tmp# netstat -tn | wc -l 70597
Any ideas why Tor can't bind to sockets?
Actually, we only use SO_REUSEADDR when binding listening sockets. The errors you're seeing are likely because you can't open a new socket for an outbound connection. And we don't use SO_REUSEADDR when creating outbound sockets: see connection_connect().
We also don't set SO_REUSEADDR on the new socket we make after receiving connections on a listening socket: see connection_handle_listener_read().
I don't know what behavior to expect, but I would not be surprised to learn that we should set it in both of these cases too. Worth experimenting.
--Roger
Am 04.04.2011 16:56, schrieb Roger Dingledine:
Actually, we only use SO_REUSEADDR when binding listening sockets. The errors you're seeing are likely because you can't open a new socket for an outbound connection. And we don't use SO_REUSEADDR when creating outbound sockets: see connection_connect().
We also don't set SO_REUSEADDR on the new socket we make after receiving connections on a listening socket: see connection_handle_listener_read().
I don't know what behavior to expect, but I would not be surprised to learn that we should set it in both of these cases too. Worth experimenting.
Certainly I'm willing to take part in this experiment. It might be a good idea if a more experienced programmer than I am does the coding.
regards Olaf
tor-relays@lists.torproject.org