Opened 4 months ago

Last modified 4 weeks ago

#2406 new defect

Android - net.i2p.android.I2PActivity has leaked ServiceConnection net.i2p.android.I2PActivityBase

Reported by: meeh Owned by: meeh
Priority: minor Milestone: undecided
Component: apps/android Version: 0.9.38
Keywords: Cc:
Parent Tickets:

Description

2019-01-24 19:45:09.365 11901-11901/net.i2p.android.donate.debug E/ActivityThread: Activity net.i2p.android.I2PActivity has leaked ServiceConnection? net.i2p.android.I2PActivityBase$RouterConnection?@d2661d7 that was originally bound here

android.app.ServiceConnectionLeaked?: Activity net.i2p.android.I2PActivity has leaked ServiceConnection? net.i2p.android.I2PActivityBase$RouterConnection?@d2661d7 that was originally bound here

at android.app.LoadedApk?$ServiceDispatcher?.<init>(LoadedApk?.java:1336)
at android.app.LoadedApk?.getServiceDispatcher(LoadedApk?.java:1231)
at android.app.ContextImpl?.bindServiceCommon(ContextImpl?.java:1450)
at android.app.ContextImpl?.bindService(ContextImpl?.java:1422)
at android.content.ContextWrapper?.bindService(ContextWrapper?.java:636)
at net.i2p.android.I2PActivityBase.bindRouter(I2PActivityBase.java:157)
at net.i2p.android.I2PActivityBase.onStart(I2PActivityBase.java:59)
at net.i2p.android.I2PActivity.onStart(I2PActivity.java:179)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1248)
at android.app.Activity.performStart(Activity.java:6696)
at android.app.ActivityThread?.performLaunchActivity(ActivityThread?.java:2612)
at android.app.ActivityThread?.handleLaunchActivity(ActivityThread?.java:2710)
at android.app.ActivityThread?.-wrap12(ActivityThread?.java)
at android.app.ActivityThread?$H.handleMessage(ActivityThread?.java:1461)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread?.main(ActivityThread?.java:6088)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit?$MethodAndArgsCaller?.run(ZygoteInit?.java:886)
at com.android.internal.os.ZygoteInit?.main(ZygoteInit?.java:776)

Subtickets (add)

Change History (2)

comment:1 Changed 4 months ago by zzz

  • Component changed from unspecified to apps/android
  • Owner set to meeh

comment:2 Changed 4 weeks ago by zzz

So if auto-start is off, in I2PActivityBase, we only call bindRouter(), not startRouter().

See top answer at https://stackoverflow.com/questions/1992676/activity-app-name-has-leaked-serviceconnection-serviceconnection-name438030

reported stack trace is where it was 'originally bound' so that doesn't help us catch where the "leaked" exception is thrown.

This SO is probably more appropriate, it says if we bind then we have to unbind, which we do in onStop().

https://stackoverflow.com/questions/31296480/service-has-leaked-serviceconnection-that-was-originally-bound-here

So are there any cases where we don't call unbindService()? According to life cycle diagram, everything goes through onStop()

Note: See TracTickets for help on using tickets.