rlayhacker / torchat

Automatically exported from code.google.com/p/torchat
0 stars 0 forks source link

torchat crashed and blocked it's own port #90

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
After a crash of torchat on my debian squeeze machine I wanted to start torchat 
again. But it refused to start up with following message window:

"TorChat: Port already in use

Something, probably another TorChat instance, is already listening at 
127.0.0.1:11009. You must create another profile using different ports to be 
able to start TorChat a second time."

Starting it from commandline printed showed this:

"username@computer:~$ torchat
trying to find suitable python version
searching for python2
searching for python2.7
searching for python2.6
starting torchat with python2.6
command line arguments:
/usr/lib/torchat/tc_client.py:30: DeprecationWarning: the md5 module is 
deprecated; use hashlib instead
  import md5
(0) [config,418,main] python version 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) 
[GCC 4.4.5]
(0) [config,425,main] script directory is /usr/lib/torchat
(0) [config,426,main] data directory is /home/username/.torchat
(0) [config,267,tb] ----- start traceback -----
Traceback (most recent call last):
  File "/usr/lib/torchat/tc_client.py", line 1866, in tryBindPort
    s.bind((interface, port))
  File "<string>", line 1, in bind
error: [Errno 98] Die Adresse wird bereits verwendet
   ----- end traceback -----"

About the crash itself: I just received a file (not accepted yet) and a chat 
window was open, though no message recently sent.
I had to log my user out and in again to be able to start torchat again.
A solution would be to fix the blocking of a port after a crash or the 
possibility to stop another torchat client from listening to the port, when you 
start a new torchat instance.

Original issue reported on code.google.com by kdg83...@trash-mail.com on 17 Jan 2011 at 5:21

GoogleCodeExporter commented 8 years ago
I think the best solution would be to make it not crash at all. Putting a lot 
of effort into working around crashes and living with them instead of fixing 
the original cause is not what I want. TorChat is supposed to run without 
crashing. We must find the reason for the crash.

Until then: you can find the offending process with netstat -ap | grep 11009, 
most likely it is one of the helper shell scripts that is still running, also 
there will be an instance of tor running that must be killed separately.

I need more information about how the crash can be provoked

Original comment by prof7...@gmail.com on 17 Jan 2011 at 9:43

GoogleCodeExporter commented 8 years ago

Original comment by prof7...@gmail.com on 17 Jan 2011 at 10:16

GoogleCodeExporter commented 8 years ago
First: Thanks for the efforts you put into torchat! :-)
Making torchat not crash at all is definitely the best reason. But better crash 
handling might be a good idea anyway (from a amateur programmers view).

I will try to catch the offending process with netstat, when/if it happens 
again. Last time I did restart tor, but torchat's port was still blocked.

At the moment I can't give you more information about how the crash can be 
provoked, since I didn't start it from the command line. Anything I can do to 
make torchat print more than the standard output to debug it easier?

Original comment by kdg83...@trash-mail.com on 18 Jan 2011 at 3:46

GoogleCodeExporter commented 8 years ago
you can try to enable debug logging by setting the log level to 1 or 2 and 
specifying a log file. For example:

log_level = 2
log_file = torchat.log

this will then try to redirect everything that is written to stdout or stderr 
into the log file. But in some cases when the process is killed unexpectedly 
(along with the logging mechanism) this also does not catch everything, 
starting torchat from a console is then the next option if there is nothing 
obvious in the log file.

Please remember to manually remove or edit the IDs of your contacts from the 
log file if you post portions of it here (if IDs show up in the relevant parts).

Original comment by prof7...@gmail.com on 18 Jan 2011 at 10:14

GoogleCodeExporter commented 8 years ago
Please help me some more, I seem to be doing something wrong. I tried to enable 
the logging in torchat's files config.py as you suggested and torrc.txt 
(uncommenting "SafeLogging 0" and "Log info File tor.log" but nothing resulted 
in a log file.

I'll make sure to remove IDs from anything I post, thanks for pointing that out.

Original comment by kdg83...@trash-mail.com on 18 Jan 2011 at 12:39

GoogleCodeExporter commented 8 years ago
in the torchat.ini in the section [logging]. 

you dont have to change any .py files and also the setting in torrc.txt only 
affects the logging of tor itself (they are separate), but it seems it is not 
tor that is crashing, its torchat.

Original comment by prof7...@gmail.com on 18 Jan 2011 at 12:50

GoogleCodeExporter commented 8 years ago
Thanks. I should have checked there too. Logging (and deleting not useful 
logs), will report back if it happens again.

Original comment by kdg83...@trash-mail.com on 20 Jan 2011 at 10:37

GoogleCodeExporter commented 8 years ago
also you should start it from a console, this might catch additional 
information, depending on how hard it is crashing it might not have the 
opportunity to create a python traceback or use the redirected stdio anymore 
and directly output to the console.

Original comment by prof7...@gmail.com on 20 Jan 2011 at 10:52