diff --git a/internal/tunnel/torembed.go b/internal/tunnel/torembed.go index a55a6183c4..df7bf67991 100644 --- a/internal/tunnel/torembed.go +++ b/internal/tunnel/torembed.go @@ -29,9 +29,10 @@ func getTorStartConf(config *Config, dataDir string, extraArgs []string) (*tor.S config.logger().Infof("tunnel: tor: exec: %s %s", dataDir, strings.Join(extraArgs, " ")) return &tor.StartConf{ - ProcessCreator: creator, - DataDir: dataDir, - ExtraArgs: extraArgs, - NoHush: true, + ProcessCreator: creator, + UseEmbeddedControlConn: true, + DataDir: dataDir, + ExtraArgs: extraArgs, + NoHush: true, }, nil } diff --git a/internal/tunnel/tormobile.go b/internal/tunnel/tormobile.go index c67f513824..651ed325d8 100644 --- a/internal/tunnel/tormobile.go +++ b/internal/tunnel/tormobile.go @@ -20,6 +20,13 @@ func getTorStartConf(config *Config, dataDir string, extraArgs []string) (*tor.S config.logger().Infof("tunnel: tor: exec: %s %s", dataDir, strings.Join(extraArgs, " ")) return &tor.StartConf{ + // Implementation note: go-libtor leaks a file descriptor when you set + // UseEmbeddedControlConn, as documented by + // + // https://github.com/ooni/probe/issues/2405 + // + // This is why we're not using this field for now. The above mentioned + // issue also refers to what a possible fix would look like. ProcessCreator: libtor.Creator, DataDir: dataDir, ExtraArgs: extraArgs,