Bug #2046

Orbot notification on but not actually running

Added by n8fr8 over 4 years ago. Updated almost 4 years ago.

Status:ResolvedStart date:10/09/2013
Priority:NormalDue date:
Assignee:n8fr8% Done:

0%

Category:-Spent time:-
Target version:v14 - April Anons
Component:

Description

It has been reproduced again.

Orbot was manually started (both straight from Orbot, and then from Martus passed through to Orbot in another instance). It was not manually stopped, so it should of been running. It wasn't, yet the onion icon was still showing. We realized this, after opening Orbot and it actually wasn't active. I've paste some Orbot logs below from the day, if that is useful.

Thanks
Barbra

0-09 10:24:10.211 380-676/? I/ActivityManager? START u0 {act=org.torproject.android.START_TOR cmp=org.torproject.android/.Orbot} from pid 4124
10-09 10:24:10.305 380-391/? I/ActivityManager? Start proc org.torproject.android for activity org.torproject.android/.Orbot: pid=4423 uid=10073 gids={50073, 3003, 1028}
10-09 10:24:15.422 380-8257/? W/ActivityManager? Duplicate finish request for ActivityRecord{42748000 u0 org.torproject.android/.Orbot}
10-09 10:24:15.422 380-1032/? W/ActivityManager? Duplicate finish request for ActivityRecord{42748000 u0 org.torproject.android/.Orbot}
10-09 10:24:16.203 4423-4423/? E/ActivityThread? Activity org.torproject.android.Orbot has leaked ServiceConnection org.torproject.android.Orbot$3@420bedb0 that was originally bound here
android.app.ServiceConnectionLeaked: Activity org.torproject.android.Orbot has leaked ServiceConnection org.torproject.android.Orbot$3@420bedb0 that was originally bound here
at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:974)
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:868)
at android.app.ContextImpl.bindServiceAsUser(ContextImpl.java:1452)
at android.app.ContextImpl.bindService(ContextImpl.java:1440)
at android.content.ContextWrapper.bindService(ContextWrapper.java:496)
at org.torproject.android.Orbot.bindService(Orbot.java:1099)
at org.torproject.android.Orbot.onResume(Orbot.java:429)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
at android.app.Activity.performResume(Activity.java:5211)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2780)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2819)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2266)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
10-09 11:05:53.537 380-8257/? I/ActivityManager? START u0 {cmp=org.torproject.android/.Orbot bnds=[0,102][720,230]} from pid -1
10-09 11:05:53.552 380-8257/? W/ActivityManager? startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=org.torproject.android/.Orbot bnds=[0,102][720,230] }
10-09 11:05:53.630 380-380/? I/ActivityManager? Start proc org.torproject.android for activity org.torproject.android/.Orbot: pid=8482 uid=10073 gids={50073, 3003, 1028}
10-09 11:06:45.013 380-592/? I/WindowState? WIN DEATH: Window{42db90b8 u0 org.torproject.android/org.torproject.android.Orbot}
10-09 11:06:50.521 380-672/? I/ActivityManager? START u0 {cmp=org.torproject.android/.Orbot bnds=[0,102][720,230]} from pid -1
10-09 11:06:50.521 380-672/? W/ActivityManager? startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=org.torproject.android/.Orbot bnds=[0,102][720,230] }
10-09 11:06:50.599 380-380/? I/ActivityManager? Start proc org.torproject.android for activity org.torproject.android/.Orbot: pid=9223 uid=10073 gids={50073, 3003, 1028}
10-09 11:08:02.977 380-679/? I/ActivityManager? START u0 {cmp=org.torproject.android/.Orbot bnds=[0,102][720,230]} from pid -1
10-09 11:08:02.977 380-679/? W/ActivityManager? startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=org.torproject.android/.Orbot bnds=[0,102][720,230] }
10-09 11:22:52.395 380-3351/? I/ActivityManager? START u0 {cmp=org.torproject.android/.Orbot bnds=[0,242][720,370]} from pid -1
10-09 11:22:52.395 380-3351/? W/ActivityManager? startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=org.torproject.android/.Orbot bnds=[0,242][720,370] }
10-09 11:23:02.091 9223-9223/? E/ActivityThread? Activity org.torproject.android.Orbot has leaked ServiceConnection org.torproject.android.Orbot$3@420b7b90 that was originally bound here
android.app.ServiceConnectionLeaked: Activity org.torproject.android.Orbot has leaked ServiceConnection org.torproject.android.Orbot$3@420b7b90 that was originally bound here
at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:974)
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:868)
at android.app.ContextImpl.bindServiceAsUser(ContextImpl.java:1452)
at android.app.ContextImpl.bindService(ContextImpl.java:1440)
at android.content.ContextWrapper.bindService(ContextWrapper.java:496)
at org.torproject.android.Orbot.bindService(Orbot.java:1099)
at org.torproject.android.Orbot.onResume(Orbot.java:429)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
at android.app.Activity.performResume(Activity.java:5211)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2780)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2819)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2266)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
10-09 11:23:36.513 380-676/? I/ActivityManager? START u0 {cmp=org.torproject.android/.Orbot bnds=[0,242][720,370]} from pid -1
10-09 11:23:36.513 380-676/? W/ActivityManager? startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=org.torproject.android/.Orbot bnds=[0,242][720,370] }
10-09 11:23:36.598 380-391/? I/ActivityManager? Start proc org.torproject.android for activity org.torproject.android/.Orbot: pid=13920 uid=10073 gids={50073, 3003, 1028}
10-09 11:23:37.614 380-395/? I/ActivityManager? Displayed org.torproject.android/.Orbot: +1s27ms
10-09 11:23:45.575 13920-13920/? E/ActivityThread? Activity org.torproject.android.Orbot has leaked ServiceConnection org.torproject.android.Orbot$3@420bb328 that was originally bound here
android.app.ServiceConnectionLeaked: Activity org.torproject.android.Orbot has leaked ServiceConnection org.torproject.android.Orbot$3@420bb328 that was originally bound here
at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:974)
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:868)
at android.app.ContextImpl.bindServiceAsUser(ContextImpl.java:1452)
at android.app.ContextImpl.bindService(ContextImpl.java:1440)
at android.content.ContextWrapper.bindService(ContextWrapper.java:496)
at org.torproject.android.Orbot.bindService(Orbot.java:1099)
at org.torproject.android.Orbot.onResume(Orbot.java:429)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
at android.app.Activity.performResume(Activity.java:5211)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2780)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2819)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2266)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
10-09 11:23:48.364 380-380/? I/ActivityManager? START u0 {cmp=org.torproject.android/.Orbot bnds=[0,242][720,370]} from pid -1
10-09 11:23:48.364 380-380/? W/ActivityManager? startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=org.torproject.android/.Orbot bnds=[0,242][720,370] }
10-09 11:23:48.575 380-391/? I/ActivityManager? Start proc org.torproject.android for activity org.torproject.android/.Orbot: pid=14231 uid=10073 gids={50073, 3003, 1028}
10-09 11:23:49.411 380-395/? I/ActivityManager? Displayed org.torproject.android/.Orbot: +846ms
10-09 11:23:54.645 14231-14231/? E/ActivityThread? Activity org.torproject.android.Orbot has leaked ServiceConnection org.torproject.android.Orbot$3@420bd098 that was originally bound here
android.app.ServiceConnectionLeaked: Activity org.torproject.android.Orbot has leaked ServiceConnection org.torproject.android.Orbot$3@420bd098 that was originally bound here
at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:974)
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:868)
at android.app.ContextImpl.bindServiceAsUser(ContextImpl.java:1452)
at android.app.ContextImpl.bindService(ContextImpl.java:1440)
at android.content.ContextWrapper.bindService(ContextWrapper.java:496)
at org.torproject.android.Orbot.bindService(Orbot.java:1099)
at org.torproject.android.Orbot.onResume(Orbot.java:429)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
at android.app.Activity.performResume(Activity.java:5211)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2780)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2819)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2266)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)

notification_updater_amoghbl1.patch Magnifier - Recalls service on receiving at most 10 packets and hence keeps the service active which in turn keeps the notification updated. (6.65 KB) amoghbl1, 11/01/2013 02:33 pm

notification_updater_amoghbl1.patch Magnifier (1.54 KB) amoghbl1, 12/14/2013 08:55 pm

History

#1 Updated by n8fr8 over 4 years ago

One important thing to note on this issue, is that if an app is set to proxy through Orbot's localhost:9050 socks proxy (or 8118 http), and Orbot is off, then the app will not be able to connect.

In short, we "fail closed", as opposed to "open".

#2 Updated by amoghbl1 about 4 years ago

I've solved the notification updater problem , it turned out that the OS kept killing the service (TorService.java) at regular intervals.
I first converted the service into a STICKY_SERVICE which is supposed to get called again when the system regains memory required for the operation of this service but , on testing , found out that this only kept the service running in the background for a few minutes before killing it again just like before! Hence , I have changed the service to call itself every 10th packet that it receives (bandwidthUsed function). Thus , every time the system kills the service , it gets "cached" first and after receiving 10 packets(at most) it calls itself and hence the service remains active. This has solved the notification updating problem .

#3 Updated by amoghbl1 about 4 years ago

OK , the above submitted patch has been modified (I think there was a mistake in the format-patch command I ran earlier)
The new version has been added below!

#4 Updated by n8fr8 about 4 years ago

  • Target version set to v13 - For Aaron

#5 Updated by n8fr8 about 4 years ago

  • Status changed from In Progress to Resolved

Great fix!

#6 Updated by n8fr8 almost 4 years ago

  • Target version changed from v13 - For Aaron to v14 - April Anons

Also available in: Atom PDF