microg / microg/IchnaeaNlpBackend
System crashing after fetch attempts happen
- Dominant language
- Java
- Stars
- 124
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
When using the Mozilla backend for UnifiedNlp on Lineage+microG I get a reboot. I am currently not able to reproduce this crash extremely reliably but it seems to be related to use of Instagram and NewPipe one after another. Here's a snippet from logcat:
```
08-27 21:37:37.881 1267 1745 W Watchdog: *** WATCHDOG KILLING SYSTEM PROCESS: Blocked in handler on main thread (main)
08-27 21:37:37.886 1267 1745 W Watchdog: main annotated stack trace:
08-27 21:37:37.886 1267 1745 W Watchdog: at com.android.server.ServiceWatcher.onServiceDisconnected(ServiceWatcher.java:384)
08-27 21:37:37.887 1267 1745 W Watchdog: - waiting to lock <0x082047a2> (a java.lang.Object)
08-27 21:37:37.887 1267 1745 W Watchdog: at android.app.LoadedApk$ServiceDispatcher.doDeath(LoadedApk.java:1749)
08-27 21:37:37.887 1267 1745 W Watchdog: at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1764)
08-27 21:37:37.887 1267 1745 W Watchdog: at android.os.Handler.handleCallback(Handler.java:873)
08-27 21:37:37.887 1267 1745 W Watchdog: at android.os.Handler.dispatchMessage(Handler.java:99)
08-27 21:37:37.887 1267 1745 W Watchdog: at android.os.Looper.loop(Looper.java:193)
08-27 21:37:37.887 1267 1745 W Watchdog: at com.android.server.SystemServer.run(SystemServer.java:480)
08-27 21:37:37.887 1267 1745 W Watchdog: at com.android.server.SystemServer.main(SystemServer.java:302)
08-27 21:37:37.887 1267 1745 W Watchdog: at java.lang.reflect.Method.invoke(Native Method)
08-27 21:37:37.887 1267 1745 W Watchdog: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
08-27 21:37:37.887 1267 1745 W Watchdog: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:838)
08-27 21:37:37.888 1267 1745 W Watchdog: *** GOODBYE!
08-27 21:37:38.074 8542 8542 E AndroidRuntime: FATAL EXCEPTION: main
08-27 21:37:38.074 8542 8542 E AndroidRuntime: Process: com.android.phone, PID: 8542
08-27 21:37:38.074 8542 8542 E AndroidRuntime: DeadSystemException: The system died; earlier logs will point to the root cause
08-27 21:37:38.079 6955 6955 E AndroidRuntime: FATAL EXCEPTION: main
08-27 21:37:38.079 6955 6955 E AndroidRuntime: Process: org.microg.nlp.backend.ichnaea, PID: 6955
08-27 21:37:38.079 6955 6955 E AndroidRuntime: java.lang.RuntimeException: Unable to unbind to service org.microg.nlp.backend.ichnaea.BackendService@9fb379c with Intent { act=org.microg.nlp.LOCATION_BACKEND pkg=org.microg.nlp.backend.ichnaea cmp=org.microg.nlp.backend.ichnaea/.BackendService }: java.lang.IllegalStateException: Do not call onClose if not opened before
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at android.app.ActivityThread.handleUnbindService(ActivityThread.java:3641)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at android.app.ActivityThread.access$1500(ActivityThread.java:200)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1682)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6718)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Do not call onClose if not opened before
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at org.microg.nlp.api.AbstractBackendHelper.onClose(AbstractBackendHelper.java:47)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at org.microg.nlp.api.CellBackendHelper.onClose(CellBackendHelper.java:382)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at org.microg.nlp.api.HelperLocationBackendService.onClose(HelperLocationBackendService.java:64)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at org.microg.nlp.backend.ichnaea.BackendService.onClose(BackendService.java:153)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at org.microg.nlp.api.LocationBackendService.disconnect(LocationBackendService.java:80)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at org.microg.nlp.api.AbstractBackendService.onUnbind(AbstractBackendService.java:58)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: at android.app.ActivityThread.handleUnbindService(ActivityThread.java:3625)
08-27 21:37:38.079 6955 6955 E AndroidRuntime: ... 8 more
08-27 21:37:38.131 618 635 D NetlinkEvent: Unknown ifindex 33 in RTM_DELADDR
08-27 21:37:38.364 8741 8741 I wificond: wificond is starting up...
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the unbind path in AbstractBackendService and LocationBackendService, then inspect BackendService.java and AbstractBackendHelper.java at the stack-trace locations. Use the provided logcat and the Instagram/NewPipe sequence to investigate the service disconnect. Done means the sequence no longer causes the system watchdog reboot or the onClose exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100