microg / microg/IchnaeaNlpBackend

BackendService has leaked IntentReceiver and Receiver not registered: org.microg.nlp.api.WiFiBackendHelper

Open
#59 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
124
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
I just get the crash without doing nothing special.

**System**
Android Version: 7
Custom ROM: LineageOS 14.1

**microG**
microG Core version: 0.2.24.214816
IchnaeaNlpBackend version: 1.5.0
microG Self-Check results: All ticked

**Additional context**
```
[ 05-08 19:18:14.698 3488: 3488 E/ActivityThread ]
Service org.microg.nlp.backend.ichnaea.BackendService has leaked IntentReceiver org.microg.nlp.api.WiFiBackendHelper$1@ba2a62d that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Service org.microg.nlp.backend.ichnaea.BackendService has leaked IntentReceiver org.microg.nlp.api.WiFiBackendHelper$1@ba2a62d that was originally registered here. Are you missing a call to unregisterReceiver()?
at android.app.LoadedApk$ReceiverDispatcher.(LoadedApk.java:1159)
at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:946)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1302)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1282)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1276)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:586)
at org.microg.nlp.api.WiFiBackendHelper.onOpen(WiFiBackendHelper.java:80)
at org.microg.nlp.api.HelperLocationBackendService.addHelper(HelperLocationBackendService.java:33)
at org.microg.nlp.backend.ichnaea.BackendService.reloadSettings(BackendService.java:139)
at org.microg.nlp.backend.ichnaea.BackendService.onOpen(BackendService.java:110)
at org.microg.nlp.api.LocationBackendService$Backend.open(LocationBackendService.java:88)
at org.microg.nlp.api.LocationBackend$Stub.onTransact(LocationBackend.java:84)
at android.os.Binder.execTransact(Binder.java:565)

[ 05-08 19:18:14.716 2364: 2964 W/ActivityManager ]
Scheduling restart of crashed service com.google.android.gms/org.microg.nlp.location.v3.LocationService in 1000ms

[ 05-08 19:18:14.716 2364: 2964 W/ActivityManager ]
Scheduling restart of crashed service com.google.android.gms/org.microg.nlp.geocode.v1.GeocodeService in 10995ms

[ 05-08 19:18:14.717 2364: 2964 W/ActivityManager ]
Scheduling restart of crashed service com.google.android.gms/.analytics.service.AnalyticsService in 20995ms
```

```
[ 05-08 19:20:22.831 2364: 9142 I/ActivityManager ]
START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.messaging/.ui.conversationlist.ConversationListActivity bnds=[20,695][108,800] (has extras)} from uid 10029 on display 0

[ 05-08 19:20:22.931 2364: 2519 I/ActivityManager ]
Start proc 9456:com.android.messaging/u0a67 for activity com.android.messaging/.ui.conversationlist.ConversationListActivity

[ 05-08 19:20:23.604 3488: 3488 E/AndroidRuntime ]
FATAL EXCEPTION: main
Process: org.microg.nlp.backend.ichnaea, PID: 3488
java.lang.RuntimeException: Unable to create service org.microg.nlp.backend.ichnaea.BackendService: java.lang.IllegalArgumentException: Receiver not registered: org.microg.nlp.api.WiFiBackendHelper$1@ba2a62d
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3226)
at android.app.ActivityThread.-wrap5(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1586)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6186)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Caused by: java.lang.IllegalArgumentException: Receiver not registered: org.microg.nlp.api.WiFiBackendHelper$1@ba2a62d
at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:1007)
at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1330)
at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:608)
at org.microg.nlp.api.WiFiBackendHelper.onClose(WiFiBackendHelper.java:88)
at org.microg.nlp.api.HelperLocationBackendService.removeHelpers(HelperLocationBackendService.java:40)
at org.microg.nlp.backend.ichnaea.BackendService.reloadSettings(BackendService.java:126)
at org.microg.nlp.backend.ichnaea.BackendService.reloadInstanceSettings(BackendService.java:118)
at org.microg.nlp.backend.ichnaea.BackendService.onCreate(BackendService.java:61)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3216)
... 8 more

[ 05-08 19:20:23.654 2364: 9481 W/DropBoxManagerService ]
Dropping: system_app_crash (1864 > 0 bytes)

[ 05-08 19:20:23.670 2364: 2375 D/MmsServiceBroker ]
getCarrierConfigValues() by com.android.messaging

[ 05-08 19:20:24.082 2364: 7794 D/MmsServiceBroker ]
getCarrierConfigValues() by com.android.messaging

[ 05-08 19:20:25.928 2364: 2376 D/MmsServiceBroker ]
getCarrierConfigValues() by com.android.messaging

[ 05-08 19:20:33.717 2364: 2519 I/ActivityManager ]
Killing 3488:org.microg.nlp.backend.ichnaea/u0a65 (adj 0): crash

[ 05-08 19:20:33.717 2364: 2519 D/ActivityManager ]
cleanUpApplicationRecord -- 3488
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with org.microg.nlp.api.WiFiBackendHelper, especially onOpen and onClose, then follow the lifecycle through HelperLocationBackendService and BackendService.reloadSettings. Reproduce the service reload path described in the Android 7 logs and verify that receiver cleanup no longer reports a leaked or unregistered Receiver.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.