Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rare DeadSystemException when device (AndroidTV) goes to sleep #387

Open
stari4ek opened this issue Oct 21, 2019 · 4 comments
Open

Rare DeadSystemException when device (AndroidTV) goes to sleep #387

stari4ek opened this issue Oct 21, 2019 · 4 comments
Labels

Comments

@stari4ek
Copy link

Describe the bug
I'm seeing rare crashes in Crashlytics with callstack:

java.lang.RuntimeException: android.os.DeadSystemException
	at android.net.ConnectivityManager.getActiveNetworkInfo(ConnectivityManager.java:797)
	at com.github.pwittchen.reactivenetwork.library.rx2.Connectivity.create(Connectivity.java:65)
	at com.github.pwittchen.reactivenetwork.library.rx2.Connectivity.create(Connectivity.java:50)
	at com.github.pwittchen.reactivenetwork.library.rx2.network.observing.strategy.MarshmallowNetworkObservingStrategy$5.onLost(MarshmallowNetworkObservingStrategy.java:165)
	at android.net.ConnectivityManager$CallbackHandler.handleMessage(ConnectivityManager.java:2845)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:154)
	at android.os.HandlerThread.run(HandlerThread.java:61)

Most probably device is going to sleep or power off. And there is network notification dispatched while VM is dying.

Expected behavior
It would be nice to catch those errors and route with onError

Device:

  • Android: 7.0
  • Android Build: SVP4KDTV15_EU-user 7.0 NRD91N.S34 5.433 release-keys
  • Manufacturer: Sony
  • Model: BRAVIA 4K 2015
  • Thread: ConnectivityManager-797
implementation 'com.github.pwittchen:reactivenetwork-rx2:3.0.6'
@pwittchen pwittchen added the bug label Oct 21, 2019
@pwittchen
Copy link
Owner

pwittchen commented Oct 21, 2019

Hi @stari4ek,

Thanks for reporting this. According to the logs, it may be related to ConnectivityManager.getActiveNetworkInfo() method from Android API, which could throw DeadSystemException. I haven't seen that error before. Maybe catching this error while getting activeNetworkInfo will solve this problem. I'll have a look on that.

Regards,
Piotr

@stari4ek
Copy link
Author

stari4ek commented Oct 21, 2019

Android: 8.0.0
Android Build: 31100 OTT1.180130.001
Manufacturer: SHARP
Model: AQUOS-4KTVX17
Thread: main-2

java.lang.RuntimeException: Unable to stop service by.stari4ek.iptv4atv.tvinput.service.IptvTvInputService@4b1810b: java.lang.RuntimeException: android.os.DeadSystemException
	at android.app.ActivityThread.handleStopService(ActivityThread.java:3587)
	at android.app.ActivityThread.-wrap26(ActivityThread.java:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1703)
	at android.os.Handler.dispatchMessage(Handler.java:105)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6541)
	at java.lang.reflect.Method.invoke(Method.java)
	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.RuntimeException: android.os.DeadSystemException
	at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1438)
	at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:639)
	at com.github.karczews.rxbroadcastreceiver.RxBroadcastReceiver$ReceiverDisposable.dispose(RxBroadcastReceiver.java:71)
	at io.reactivex.internal.disposables.DisposableHelper.dispose(DisposableHelper.java:124)
	
        ... bunch of own Rx operators

	at by.stari4ek.iptv4atv.tvinput.service.IptvTvInputService.onDestroy(IptvTvInputService.java:37)
	at android.app.ActivityThread.handleStopService(ActivityThread.java:3569)

@pwittchen
Copy link
Owner

Error from the last log looks like it's caused by another library, but general problem is probably the same.

@stari4ek
Copy link
Author

ah. ouch.
you're right. Sorry for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants