Skip to content
Snippets Groups Projects
Closed (moved) Pluggable Transports on windows are killed with TerminateProcess
  • View options
  • Pluggable Transports on windows are killed with TerminateProcess

  • View options
  • Closed (moved) Issue created by Yawning Angel

    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.

    Linked items ... 0

  • Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first
    Loading Loading Loading Loading Loading Loading Loading Loading Loading Loading