Seems like Tor does not successfuly kill obfs4proxy when it's no longer used. It's unclear why. Maybe obfs4proxy never receives the SIGTERM, or never notices that the stdin is closed?
Experiment:
Startup Tor Browser using default obfs4 bridges.
Check that obfs4proxy process has spawned (ps -fax | grep obfs)
Reconfigure Tor Browser to not use bridges at all.
Check that obfs4proxy process is still there...
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
Seems like Tor does not successfuly kill obfs4proxy when it's no longer used. It's unclear why.
Maybe obfs4proxy never receives the SIGTERM, or never notices that the stdin is closed?
It's "tor never issues the SIGTERM, or close stdin".
As far as I can tell, the Bridge directives are always parsed, regardless of the UseBridges setting, so if a Bridge entry exists for a transport at all (regardless of it if is used), the PT will always exist.
Removing Bridges with RESETCONF doesn't seem to affect bridge_list at the time when pts would be torn down either.
All of this is crap is half broken on the tor side basically, and it has nothing to do with the process teardown code.
but then they (both the transport and the managed proxy) get rescued in pt_kickstart_proxy:
if (mp->was_around_before_config_read) { /* If this managed proxy was around even before we read the config this time, it means that it was already enabled before and is not useless and should be kept. If it's marked for removal, unmark it and make sure that we check whether it needs to be restarted. */ if (mp->marked_for_removal) { mp->marked_for_removal = 0; check_if_restarts_needed = 1; } /* For each new transport, check if the managed proxy used to support it before the SIGHUP. If that was the case, make sure it doesn't get removed because we might reuse it. */ SMARTLIST_FOREACH_BEGIN(with_transport_list, const char *, transport) { old_transport = transport_get_by_name(transport); if (old_transport) old_transport->marked_for_removal = 0; } SMARTLIST_FOREACH_END(transport); }
And with comments like that...are we sure this ever worked? It sure seems to be intentional about keeping them around.
Wugh. There's some sort of subtlety in pt_configure_remaining_proxies() where it restarts managed proxies sometimes, and it might implicitly drop transports it doesn't know it needs, or something. See the call to sweep_transport_list() in proxy_prepare_for_restart(). But by then it's too late because pt_kickstart_proxy set mp->marked_for_removal to 0 and nothing ever marks it again.
(Whoever decided that transport_t should have a marked_for_removal flag, and managed_proxy_t should have an identically named marked_for_removal flag, is not a nice person.)