[tor-commits] [nyx/master] Renaming our process could potentially crash nyx

atagar at torproject.org atagar at torproject.org
Fri Oct 19 19:55:32 UTC 2018


commit d3dd23cec8cab7eea4969d0c462a2e1abfa5b19d
Author: Damian Johnson <atagar at torproject.org>
Date:   Fri Oct 19 12:50:03 2018 -0700

    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.
---
 nyx/starter.py           | 7 ++++++-
 web/changelog/index.html | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

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>



More information about the tor-commits mailing list