From 6217b9185b4c45c49854498ebc093342328825b2 Mon Sep 17 00:00:00 2001 From: Anthony Tseng Date: Thu, 8 Oct 2020 16:05:08 -0700 Subject: [PATCH] Fix crash when automatically opening onion site and close the tor window at browser startup [8357:775:1008/110058.682124:FATAL:remote.h(97)] Check failed: is_bound(). Cannot issue Interface method calls on an unbound Remote 0 libbase.dylib 0x000000010eb7c7b9 base::debug::CollectStackTrace(void**, unsigned long) + 9 1 libbase.dylib 0x000000010ea67f43 base::debug::StackTrace::StackTrace() + 19 2 libbase.dylib 0x000000010ea8b075 logging::LogMessage::~LogMessage() + 261 3 libbase.dylib 0x000000010ea8bd5e logging::LogMessage::~LogMessage() + 14 4 libchrome_dll.dylib 0x0000000114832d6b TorLauncherFactory::OnTorControlCheckComplete() + 219 5 libchrome_dll.dylib 0x00000001148361cb base::internal::Invoker >, void ()>::RunOnce(base::internal::BindStateBase*) + 155 6 libbase.dylib 0x000000010eb09dbb base::TaskAnnotator::RunTask(char const*, base::PendingTask*) + 411 --- browser/tor/tor_launcher_factory.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/browser/tor/tor_launcher_factory.cc b/browser/tor/tor_launcher_factory.cc index d23221b903f6..a1e741e061cd 100644 --- a/browser/tor/tor_launcher_factory.cc +++ b/browser/tor/tor_launcher_factory.cc @@ -114,9 +114,13 @@ void TorLauncherFactory::LaunchTorProcess(const tor::TorConfig& config) { void TorLauncherFactory::OnTorControlCheckComplete() { DCHECK_CURRENTLY_ON(BrowserThread::UI); - tor_launcher_->Launch(config_, - base::BindOnce(&TorLauncherFactory::OnTorLaunched, - weak_ptr_factory_.GetWeakPtr())); + if (tor_launcher_.is_bound()) { + tor_launcher_->Launch(config_, + base::BindOnce(&TorLauncherFactory::OnTorLaunched, + weak_ptr_factory_.GetWeakPtr())); + } else { + is_starting_ = false; + } } void TorLauncherFactory::KillTorProcess() {