[tor-bugs] #15125 [meek]: meek-client-wrapper does not use signals well

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Mar 14 01:15:40 UTC 2015


#15125: meek-client-wrapper does not use signals well
---------------------------+-----------------
     Reporter:  infinity0  |      Owner:  dcf
         Type:  defect     |     Status:  new
     Priority:  normal     |  Milestone:
    Component:  meek       |    Version:
   Resolution:             |   Keywords:
Actual Points:             |  Parent ID:
       Points:             |
---------------------------+-----------------

Comment (by infinity0):

 Ah, I could have been wrong about not passing on the signals properly. At
 least, the commit I did that you mentioned, fixes things on my Debian
 system.

 I think the real bug is that, whilst you do pass on SIGTERM, you
 immediately then return from the main thread, which triggers the defer
 behaviour which is to send SIGKILL. This does not give the child enough
 time to clean up - for example if it has its own children, which is the
 case if meek-browser-helper is using xvfb-run. So a timer between when we
 send SIGTERM and SIGKILL is necessary. This is a fairly standard pattern
 that you will see in well-written "graceful shutdown" scripts (TERM,
 sleep, KILL), it's not that unusual. Somewhere around 10-30 seconds is
 normal.

 (Yes, signals are delivered immediately, so if you want a delay then the
 parent does need to stick around for this duration of delay, *then* send
 the second signal.)

 Closing stdin is probably not sufficient to stop firefox, no. But meek-
 browser-helper is supposed to be a shell script anyways, so we might be
 able to work with that on windows. Something along the lines of `start
 firefox; read x; kill firefox`. Needs more testing, of course.

 - https://stackoverflow.com/questions/1449188/running-windows-batch-file-
 commands-asynchronously
 - https://superuser.com/questions/657944/kill-processes-with-batch-file

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/15125#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list