Closed kloesing closed 8 years ago
The same thing happened on my OnionPerf instance.
The cause seems to be that the TGen server gets port-scanned and sent garbage, which causes the server process to crash. Upon trying to restart the TGen server, OnionPerf runs into the "Address already in use" error, because the old server closed non-gracefully and the old socket is still stuck in TIME_WAIT. After trying to start the TGen server 10 times in a row, OnionPerf gives up and terminates itself.
There are two updates we should make to TGen:
setsockopt()
to set the SO_REUSEADDR
socket option, so that the port can be bound while in TIME_WAIT.and maybe we should make a change in OnionPerf:
Note I found a log message referencing a NULL buffer in the case that a client request was not properly formed, which is why TGen was segfaulting in response to the port scanners.
That and the other changes are all in, so the server crashes should be fixed now and hopefully the server is also more stable thanks to the basic authentication I added.
My OnionPerf instance ran for about 24 hours before outputting the following warnings and terminating:
I don't really know how to debug this, that's why I'm pasting more details about my setup here in the hope that you can figure out.
Command to start OnionPerf:
Tor version 0.2.7.6-dev (git-b0474572de5b9556).
Shadow commit 05fff25690ed1ea7241e2214e689ffec525d2230.
OnionPerf commit 44fb7a49faf4ab3b0c336fac57d41b032f43a795 with a manual patch of the
--tgen-connect-ip
code:Tarball with OnionPerf data directory available at https://people.torproject.org/~karsten/volatile/onionperf-data.tar.xz