[tbb-bugs] #30239 [Applications/Tor Browser]: TBA: Gracefully handle auto-restart after crash

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Apr 25 19:09:06 UTC 2019

#30239: TBA: Gracefully handle auto-restart after crash
 Reporter:  sysrqb                               |          Owner:  tbb-
                                                 |  team
     Type:  defect                               |         Status:  new
 Priority:  Medium                               |      Milestone:
Component:  Applications/Tor Browser             |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  tbb-mobile tbb-8.5-must              |  Actual Points:
  TorBrowserTeam201904                           |
Parent ID:                                       |         Points:
 Reviewer:                                       |        Sponsor:

Comment (by sisbell):

 Replying to [comment:4 sysrqb]:
 > Shane, I'll create a patch for the tor-android-service project in tor-
 browser-build for this, but do you think this is reasonable? I haven't
 tested it yet (so this is a little bit of a guess). Essentially, I'm
 thinking about this:
 > {{{
 > diff --git
 > index a748241..80c1dfa 100644
 > ---
 > +++
 > @@ -270,7 +270,7 @@ public final class TorService extends Service
 implements TorServiceConstants, Or
 >              mExecutor.execute(new IncomingIntentRouter(intent));
 >          else
 >              Log.d(OrbotConstants.TAG, "Got null onStartCommand()
 > -        return Service.START_STICKY;
 > +        return Service.START_NOT_STICKY;
 >      }
 >      @Override
 > }}}

 Looking through the code, It looks like a restart is essentially a NOOP. A
 sticky restart will restart with a null intent, which essentially does
 nothing. This is not what we want, since it leaves the event handlers to
 still receive events from the main app, even though a tor process is not
 running. Good catch.

 One alternative to removing the STICKY flag would be to startTor on a null
 intent so it also starts up with the Android service. This really depends
 on what the main app is expecting. Without the sticky flag the main app
 will need to detect the crash and restart the service.

Ticket URL: <https://trac.torproject.org/projects/tor/ticket/30239#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online

More information about the tbb-bugs mailing list