When sending tor a HUP before it has read its config, it will die, without killing its PTs. Starting tor again will then result in more PT crashes, as the ports will already be used by previous instances.
10149 ? Sl 0:00 /usr/bin/obfs4proxy managed10581 ? Sl 0:01 /usr/bin/tor -f /etc/tor/torrc-node110582 ? S 0:00 \_ /usr/bin/python /usr/bin/obfsproxy managed10583 ? Z 0:00 \_ [obfs4proxy] <defunct>10584 ? S 0:00 \_ /usr/bin/python /usr/bin/fteproxy --managed --mode server
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
I believe the issue is generic, and not obfs4proxy specific on the pt side. I suspect obfs4proxy is prone to displaying issues here because it's managing to get through the managed pt configuration protocol before tor crashes, while obfsproxy and fte (in the example), are slower to start up and fail to write the response over stdout.
In theory something like #10047 (moved) could be done PT side if tor didn't close the stdin on the PT process, and I'm strongly tempted to add a "PT_EXIT_ON_STDIN_CLOSE" env var to the pt protocol to facilitate this.
All of this is orthogonal to "tor shouldn't crash on an early HUP".
I'm strongly tempted to add a "PT_EXIT_ON_STDIN_CLOSE" env var to the pt protocol to facilitate this.
How much does #15435 (moved)'s fix help this ticket? That is, what else are we waiting on here, and how can we move it forward?
That should be it. It's worth noting that the latest release of obfs4proxy, and newer versions of tor both have also special code to attempt to have PTs self terminate even without the env var (via PR_SET_PDEATHSIG, and ppid monitoring). Windows is kind of stuck, but that's what the env var is for.
I think we might want to close this one, either as resolved or as a duplicate of #15435 (moved)?
Or we can retitle it to simply "Tor dies if you send it a HUP before it read its config", but isn't that both kind of expected and also kind of unfixable?
Ok, I'm going to close this one since #15435 (moved) resolved the "and doesn't take PTs with it" part.
I was going to file a separate ticket for "Tor doesn't catch HUP until a while after it's started up", but I just looked through the code, and we don't register our signal handlers until after we've done our fork(), and we don't decide whether to fork() until we've read our torrc to find out if we're going to. I guess we could register the handlers before we fork... but that is going to get ugly, and we have plenty of more important things to do. Please make that ticket if you disagree. :)
Trac: Milestone: Tor: 0.3.0.x-final to Tor: 0.2.7.x-final Resolution: N/Ato fixed Status: accepted to closed