[tor-bugs] #9330 [Pluggable transport]: Pluggable Transports on windows are killed with ProcessTerminate
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu Jul 25 10:58:40 UTC 2013
#9330: Pluggable Transports on windows are killed with ProcessTerminate
--------------------------------------------+-------------------------------
Reporter: yawning | Owner: asn
Type: defect | Status: new
Priority: normal | Milestone:
Component: Pluggable transport | Version: Tor: unspecified
Keywords: pt, win32, pluggable transport | Parent:
Points: | Actualpoints:
--------------------------------------------+-------------------------------
The pluggable transport that I am writing needs to do cleanup on shutdown
(It write files to the pt_state directory, and use a child process).
The way that tor terminates pluggable transports under Windows currently
is via ProcessTerminate (common/util.c:tor_terminate_process), which is
the rough windows equivalent of SIGKILL (Immediate termination, no child
processes killed, no further code in the application gets executed).
In theory Tor is supposed to send SIGINT for a graceful shutdown but it
doesn't appear to be doing this on Windows (Does it do this at all?
obfsproxy doesn't appear to install a SIGINT handler to handle graceful
teardown per the PT spec), and furthermore Microsoft's documentation hints
at horrible evil happening if SIGINT is actually used
(http://msdn.microsoft.com/en-us/library/xdkz3x12%28v=vs.110%29.aspx).
Some way to properly handle graceful shutdown that works across all
platforms would be nice. Apparently the way Real Windows Apps approach
this problem is with GenerateConsoleCtrlEvent or with PostMessage, neither
which are portable.
Note: I don't do Windows development as a general rule so I may be missing
something obvious.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9330>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list