Bug #1927

Chatsecure crashes after app history swipe

Added by chatsecure over 4 years ago. Updated over 2 years ago.

Status:ClosedStart date:09/23/2013
Priority:HighDue date:
Assignee:devrandom% Done:

0%

Category:-
Target version:v13 - October Oooya
Component:Service

Description

Chatsecure v12.4.1 and v12.4.0 crash after some time.
How to reproduce:
Start CS and login. Then go to android home screen and delete all recent apps. Set phone in standby/sleep (pressing power button once quickly) and wait 2 minutes. When awaking the phone/unlocking lock screen you can see the CS notification symbol vanishing and reappearing with the text chatsecure, which vanishes after a second. Then if you try to open CS by pressing on the CS notification icon (lock symbol) a window pops up for milliseconds and disappears again. CS does not start anymore and you have to kill it in the apps menu.

Associated revisions

Revision 03c143dc
Added by devrandom about 4 years ago

move alarm wakeup to UI process

fixed #1927

working around OS killing foreground process that gets an alarm wakeup

possibly relevant material:

http://stackoverflow.com/questions/6645193/foreground-service-being-killed-by-android
https://code.google.com/p/android/issues/detail?id=53313

Revision d16579e2
Added by devrandom about 4 years ago

move network broadcastreceiver from :remote to main process

fixes #1927

History

#1 Updated by chatsecure over 4 years ago

This bug is still present in 12.4.2. Noticed that all you need to do to reproduce this is to close CS in recent apps. Setting the phone to sleep is not even necessary.

#2 Updated by devrandom over 4 years ago

  • Status changed from New to In Progress
  • Assignee set to devrandom
  • Target version set to v12 - March Mantra

I believe this is already fixed but we need to build another release.

#3 Updated by n8fr8 over 4 years ago

  • Status changed from In Progress to Resolved

we will test with next build, but i do believe this is resolved as well

#4 Updated by chatsecure over 4 years ago

Still present in v12.5.

#5 Updated by chatsecure over 4 years ago

This bug is not resolved and still present in v12.6.2. Please resolve this bug. Chatsecure should not exit/restart when swiped away in recent apps, but rather continue to work and not crash. This bug is crucial, because many people who use other IM apps are used to the fact that swiping away an IM app keeps the app running.

#6 Updated by n8fr8 over 4 years ago

  • Status changed from Resolved to In Progress

the submitter says its still open as of the latest build

#7 Updated by n8fr8 over 4 years ago

I've repro'd it once. Here is the crash log I see:

E/AndroidRuntime(21098): FATAL EXCEPTION: main
E/AndroidRuntime(21098): java.lang.RuntimeException: Unable to start activity ComponentInfo{info.guardianproject.otr.app.im/info.guardianproject.otr.app.im.app.NewChatActivity}: java.lang.NullPointerException
E/AndroidRuntime(21098): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
E/AndroidRuntime(21098): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
E/AndroidRuntime(21098): at android.app.ActivityThread.access$600(ActivityThread.java:141)
E/AndroidRuntime(21098): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E/AndroidRuntime(21098): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(21098): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(21098): at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime(21098): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(21098): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime(21098): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime(21098): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime(21098): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(21098): Caused by: java.lang.NullPointerException
E/AndroidRuntime(21098): at info.guardianproject.otr.app.im.app.NewChatActivity$ChatViewPagerAdapter.<init>(NewChatActivity.java:980)
E/AndroidRuntime(21098): at info.guardianproject.otr.app.im.app.NewChatActivity.onCreate(NewChatActivity.java:185)
E/AndroidRuntime(21098): at android.app.Activity.performCreate(Activity.java:5133)
E/AndroidRuntime(21098): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime(21098): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
E/AndroidRuntime(21098): ... 11 more
W/ActivityManager( 512): Force finishing activity info.guardianproject.otr.app.im/.app.NewChatActivity

#8 Updated by n8fr8 over 4 years ago

Seems related to the fact that app "swiping" on Jellybean actually kills the nbackground service as well:

https://groups.google.com/forum/#!topic/android-developers/LtmA9xbrD5A

#9 Updated by n8fr8 over 4 years ago

#10 Updated by n8fr8 over 4 years ago

  • Target version changed from v12 - March Mantra to v13 - October Oooya

#11 Updated by devrandom over 4 years ago

  • Priority changed from Immediate to High
  • Component set to Frontend

#12 Updated by devrandom over 4 years ago

Perhaps we should turn this into a feature? Swipe from history could do signout-all and stop the service. This way we will have a predictable behavior and users would know what to expect.

#13 Updated by devrandom about 4 years ago

  • Status changed from In Progress to Resolved
  • Target version changed from v13 - October Oooya to v12 - March Mantra
  • Component changed from Frontend to Service

#14 Updated by devrandom about 4 years ago

  • Subject changed from Chatsecure crashes to Chatsecure crashes after app history swipe
  • Status changed from Resolved to In Progress

#15 Updated by devrandom about 4 years ago

  • Status changed from In Progress to Resolved

oops

#16 Updated by chatsecure about 4 years ago

This is not completely resolved. Actually the app restarts when having swiped the app away and after that losing internet connection. After that the app is practically useless and needs to be killed.

#17 Updated by n8fr8 about 4 years ago

  • Status changed from Resolved to In Progress
  • Target version changed from v12 - March Mantra to v13 - October Oooya

#18 Updated by devrandom about 4 years ago

I see. That means that the issue is a general one with broadcast receivers, and we have to move the network status broadcast receiver away from the :remote process. Will take care of it ASAP.

#19 Updated by chatsecure about 4 years ago

Just for clarification. In previous versions the app crashed after swiping away without the need of a signal loss. It is only in the recent version that the app seems to work after you have swiped it away and don't lose your internet connection. To make it crash now you additionaly have to lose your connection.

#20 Updated by devrandom about 4 years ago

  • Status changed from In Progress to Resolved

#21 Updated by devrandom almost 4 years ago

Applied in changeset chatsecureandroid|commit:d16579e249ee62dd53f97a36da7ea8f4e2e60019.

#22 Updated by n8fr8 over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF