Bug #1910

Force close by OS followed by NPE

Added by devrandom over 4 years ago. Updated about 4 years ago.

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

0%

Category:-
Target version:v12 - March Mantra
Component:

Description

The issue below might not be of interest - the OS should normally not kill the app. Note that this was also submitted through Hockey.

For some unknown reason the OS decided to kill CS:

09-20 10:21:39.348 I/ActivityManager( 609): Force stopping package info.guardianproject.otr.app.im uid=10068
09-20 10:21:39.355 I/ActivityManager( 609): Killing proc 24583:info.guardianproject.otr.app.im/10068: force stop
09-20 10:21:39.355 I/ActivityManager( 609): Kill info.guardianproject.otr.app.im:remote (pid 24881): provider info.guardianproject.otr.app.im.provider.ImpsProvider in dying process info.guardianproject.otr.app.im
09-20 10:21:39.355 W/ActivityManager( 609): Force removing ActivityRecord{4107da60 info.guardianproject.otr.app.im/.app.AccountListActivity}: app died, no saved state
09-20 10:21:39.363 I/ActivityManager( 609): Killing proc 24881:info.guardianproject.otr.app.im:remote/10068: force stop
09-20 10:21:39.363 I/ActivityManager( 609): Force finishing activity ActivityRecord{4161e880 info.guardianproject.otr.app.im/.app.AccountListActivity}
09-20 10:21:39.605 I/WindowManager( 609): WIN DEATH: Window{41b5e3a8 info.guardianproject.otr.app.im/info.guardianproject.otr.app.im.app.AccountListActivity paused=true}
09-20 10:21:39.621 I/ActivityManager( 609): Start proc info.guardianproject.otr.app.im for activity info.guardianproject.otr.app.im/.app.NewChatActivity: pid=27561 uid=10068 gids={3003, 1015}
09-20 10:21:39.621 I/ActivityManager( 609): Force finishing activity ActivityRecord{41b76028 info.guardianproject.otr.app.im/.app.NewChatActivity}
09-20 10:21:39.754 I/WindowManager( 609): WIN DEATH: Window{4183f428 info.guardianproject.otr.app.im/info.guardianproject.otr.app.im.app.NewChatActivity paused=false}
09-20 10:21:39.762 I/WindowManager( 609): WIN DEATH: Window{4104de60 info.guardianproject.otr.app.im/info.guardianproject.otr.app.im.app.AccountListActivity paused=false}
09-20 10:21:39.770 I/WindowManager( 609): WINDOW DIED Window{41b5e3a8 info.guardianproject.otr.app.im/info.guardianproject.otr.app.im.app.AccountListActivity paused=true}

the app then proceeds to get an NPE when restoring the ChatView:

09-20 10:21:41.793 I/ActivityManager( 609): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=i
nfo.guardianproject.otr.app.im/.app.WelcomeActivity bnds=[565,1056][702,1184]} from pid 858
09-20 10:21:42.707 I/ActivityManager( 609): START {cmp=info.guardianproject.otr.app.im/.app.LockScreenActivity (has extras)} from pid 27561
09-20 10:21:43.004 W/InputManagerService( 609): Focus gain on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@416a
2648 (uid=10068 pid=27561)
09-20 10:21:48.309 I/ActivityManager( 609): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=i
nfo.guardianproject.otr.app.im/.app.WelcomeActivity bnds=[565,1056][702,1184]} from pid 27561
09-20 10:21:48.582 I/ActivityManager( 609): Start proc info.guardianproject.otr.app.im:remote for service info.guardianproject.otr.app.im/.se
rvice.RemoteImService: pid=27586 uid=10068 gids={3003, 1015}
09-20 10:21:48.590 I/ActivityManager( 609): START {cmp=info.guardianproject.otr.app.im/.app.AccountListActivity} from pid 27561
09-20 10:21:48.621 W/InputManagerService( 609): Focus gain on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@416a2648 (uid=10068 pid=27561)
09-20 10:22:07.332 I/ActivityManager( 609): START {cmp=info.guardianproject.otr.app.im/.app.NewChatActivity (has extras)} from pid 27561
09-20 10:22:08.527 E/AndroidRuntime(27561): FATAL EXCEPTION: main
09-20 10:22:08.527 E/AndroidRuntime(27561): java.lang.NullPointerException
09-20 10:22:08.527 E/AndroidRuntime(27561): at android.os.Parcel.readException(Parcel.java:1333)
09-20 10:22:08.527 E/AndroidRuntime(27561): at android.os.Parcel.readException(Parcel.java:1281)
09-20 10:22:08.527 E/AndroidRuntime(27561): at info.guardianproject.otr.app.im.IChatSession$Stub$Proxy.setDataListener(IChatSession.java:461)
09-20 10:22:08.527 E/AndroidRuntime(27561): at info.guardianproject.otr.app.im.app.ChatView.bindChat(ChatView.java:884)
09-20 10:22:08.527 E/AndroidRuntime(27561): at info.guardianproject.otr.app.im.app.NewChatActivity$ChatViewFragment.onCreateView(NewChatActivity.java:1508)
09-20 10:22:08.527 E/AndroidRuntime(27561): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1460)
09-20 10:22:08.527 E/AndroidRuntime(27561): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:911)
09-20 10:22:08.527 E/AndroidRuntime(27561): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1088)
09-20 10:22:08.527 E/AndroidRuntime(27561): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)

Associated revisions

Revision a0b69692
Added by devrandom over 4 years ago

Move ImpsProvider to remote process

allows UI process to be reaped by OS
fixes issue #1910

History

#1 Updated by devrandom over 4 years ago

Should investigate how often this is likely to happen. I believe that the OS will not kill the provider (which lives in the UI process), because a foreground service depends on it.

We might consider moving the provider to the service, so that the UI process can be reaped by the OS in memory pressure situations.

#2 Updated by devrandom over 4 years ago

This happened to me again today.

#3 Updated by devrandom over 4 years ago

  • Priority changed from Normal to High
  • Target version set to v12 - March Mantra

#4 Updated by devrandom over 4 years ago

The UI process is very heavy at 50MB (right after starting up).

The service process is only 11MB.

Moving the provider to the service will free up quite a bit of memory.

#5 Updated by devrandom over 4 years ago

Tracing memory allocations now.

#6 Updated by devrandom over 4 years ago

  • Status changed from New to In Progress
  • Assignee set to devrandom

#7 Updated by devrandom over 4 years ago

  • Status changed from In Progress to Resolved

#8 Updated by n8fr8 about 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF