microg / microg/GmsCore

ULP crashes with ArrayIndexOutOfBoundsException:

Open
#1,718 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
14.6k
Forks
3.2k
Avg merge
12d 11h
Merged PRs (30d)
4

Description

Describe the bug
microG crashed in the background with:

05-08 15:38:31.117 10318 10318 E AndroidRuntime: FATAL EXCEPTION: main
05-08 15:38:31.117 10318 10318 E AndroidRuntime: Process: com.google.android.gms, PID: 10318
05-08 15:38:31.117 10318 10318 E AndroidRuntime: java.lang.ArrayIndexOutOfBoundsException: length=10; index=-1
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at java.util.ArrayList.fastRemove(ArrayList.java:557)
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at java.util.ArrayList.remove(ArrayList.java:540)
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at org.microg.gms.location.UnifiedLocationProvider.removeRequest(UnifiedLocationProvider.kt:90)
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at org.microg.gms.location.GoogleLocationManager.removeLocationUpdates(GoogleLocationManager.java:185)
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at org.microg.gms.location.GoogleLocationManager.onLocationChanged(GoogleLocationManager.java:279)
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at org.microg.gms.location.GoogleLocationManager$$ExternalSyntheticLambda0.run(Unknown Source:2)
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:790)
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:164)
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6494)
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
05-08 15:38:31.117 10318 10318 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

To Reproduce
No idea, happened when using DB navigator.

System
Android Version: Android 8.1
Custom ROM: LineageOS 15.1

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 by reading UnifiedLocationProvider.kt around line 90 and follow the removeRequest call from GoogleLocationManager.java at lines 185 and 279. Investigate how a request can be removed with an index of -1; done means this background location-update path no longer crashes with ArrayIndexOutOfBoundsException.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.