summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamian Johnson <atagar@torproject.org>2018-10-19 12:50:03 -0700
committerDamian Johnson <atagar@torproject.org>2018-10-19 12:53:28 -0700
commitd3dd23cec8cab7eea4969d0c462a2e1abfa5b19d (patch)
tree236ddc7e6134fec88fbbc8079198361eef2db034
parent231ca0079cb412ff8702519cebd2548b5bd6f88e (diff)
Renaming our process could potentially crash nyx
Stem's set_process_name() raises IOErrors when unable to change the name of our process. In practice this has been moot because it only arises when lengthening our process name, and nyx always shortens it. But in one instance seems that wasn't the case... https://trac.torproject.org/projects/tor/ticket/27556 Not entirely clear why, but regardless we should definitely catch this if it arises.
-rw-r--r--nyx/starter.py7
-rw-r--r--web/changelog/index.html1
2 files changed, 7 insertions, 1 deletions
diff --git a/nyx/starter.py b/nyx/starter.py
index ab2c25c..60a9ba0 100644
--- a/nyx/starter.py
+++ b/nyx/starter.py
@@ -219,7 +219,12 @@ def _set_process_name():
"nyx <input args>".
"""
- stem.util.system.set_process_name('nyx\0%s' % '\0'.join(sys.argv[1:]))
+ process_name = 'nyx\0%s' % '\0'.join(sys.argv[1:])
+
+ try:
+ stem.util.system.set_process_name(process_name)
+ except IOError as exc:
+ stem.util.log.info("Unable to rename our process from '%s' to '%s' (%s)." % (stem.util.system.get_process_name(), process_name.replace('\0', ' '), exc))
def _shutdown_daemons(controller):
diff --git a/web/changelog/index.html b/web/changelog/index.html
index 11a2332..abd1483 100644
--- a/web/changelog/index.html
+++ b/web/changelog/index.html
@@ -73,6 +73,7 @@
<li>Connect by default to Tor Browser's default port (9151) when it's available</li>
<li>Nyxrc <b>color_override</b> configuration values only worked if camel case (<a href="https://trac.torproject.org/projects/tor/ticket/26026">ticket</a>)</li>
<li>'<b>sqlite3.OperationalError</b>' crash when ran with multiple users that share a home directory (<a href="https://trac.torproject.org/projects/tor/ticket/27938">ticket</a>)</li>
+ <li>Process renaming could potentially crash (<a href="https://trac.torproject.org/projects/tor/ticket/27556">ticket</a>)</li>
<li>Blank debug path caused us to crash (<a href="https://trac.torproject.org/projects/tor/ticket/27350">ticket</a>)</li>
</ul>
</li>