microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
8.61k stars 1.73k forks source link

[xyz.zood.george] Zood Location #1395

Open arashpayan opened 3 years ago

arashpayan commented 3 years ago

Affected app Name: Zood Location Package id: xyz.zood.george

Describe the bug The app lets users share their location with each other via en end-to-end encrypted channel. The problem occurs when the app calls getTag() on a com.google.android.gms.maps.model.Circle that is part of a map. A stack trace is provided:

02-06 23:29:15.605 E/AndroidRuntime(8147): FATAL EXCEPTION: main
02-06 23:29:15.605 E/AndroidRuntime(8147): Process: xyz.zood.george, PID: 8147
02-06 23:29:15.605 E/AndroidRuntime(8147): java.lang.NullPointerException: Attempt to invoke interface method 'android.os.IBinder com.google.android.gms.dynamic.IObjectWrapper.asBinder()' on a null object reference
02-06 23:29:15.605 E/AndroidRuntime(8147):  at com.google.android.gms.dynamic.ObjectWrapper.unwrap(com.google.android.gms:play-services-basement@@17.3.0:7)
02-06 23:29:15.605 E/AndroidRuntime(8147):  at com.google.android.gms.maps.model.Circle.getTag(Unknown Source:78)
02-06 23:29:15.605 E/AndroidRuntime(8147):  at xyz.zood.george.MainFragment.updateMarker(MainFragment.java:867)
02-06 23:29:15.605 E/AndroidRuntime(8147):  at xyz.zood.george.MainFragment.onFriendLocationUpdated(MainFragment.java:1022)
02-06 23:29:15.605 E/AndroidRuntime(8147):  at io.pijun.george.database.DB$2.run(DB.java:800)
02-06 23:29:15.605 E/AndroidRuntime(8147):  at android.os.Handler.handleCallback(Handler.java:883)
02-06 23:29:15.605 E/AndroidRuntime(8147):  at android.os.Handler.dispatchMessage(Handler.java:100)
02-06 23:29:15.605 E/AndroidRuntime(8147):  at android.os.Looper.loop(Looper.java:214)
02-06 23:29:15.605 E/AndroidRuntime(8147):  at android.app.ActivityThread.main(ActivityThread.java:7356)
02-06 23:29:15.605 E/AndroidRuntime(8147):  at java.lang.reflect.Method.invoke(Native Method)
02-06 23:29:15.605 E/AndroidRuntime(8147):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
02-06 23:29:15.605 E/AndroidRuntime(8147):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:925)

To Reproduce Steps to reproduce the behavior: Hopefully the stack trace above is sufficient, but just in case it's not, here are some user provided repro steps. :-) The following steps are for a

  1. Open Zood on Phone 1 (Samsung) and register as test123 (password is test123)
  2. Open Zood on Phone 2 (Pixel) and register as test567 (password is test567)
  3. In the Zood app on phone 2 (Pixel), assign an image as the avatar.
  4. One phone 1 (Samsung), add friend: test567.
  5. One phone 2 (Pixel), add friend test123.
  6. Both phones are in the same location.
  7. IMPORTANT: Do not enable sharing of location yet.
  8. Open Zood on both phones. Apps are stable.
  9. Tap the partner accounts on each phone (do not switch on sharing). Apps remain stable.
  10. IMPORTANT: Now make sure that the Zood app is completely closed on phone 1 (Samsung).
  11. Wait 10 seconds after killing zood on phone 1 (Samsung).
  12. On phone 2 (Pixel), open the options in Zood and tap to change the avatar.
  13. Select an image, resize to maximum you can get in square.
  14. Still on phone 2 (Pixel), share your location with your partner (test123).
  15. Zood remains stable.
  16. Back on Phone 1 (Samsung), open zood and confirm it is not sharing it's location with test567 yet.
  17. On phone 1 (Samsung), tap the profile picture of the partner (test567) and share your location.
  18. The zood app will instantly crash on phone 2 (Pixel).

Expected behavior The app should not crash

System Android Version: 10 Custom ROM: Havoc 3.11

microG microG Core version: 0.2.11.202414 microG Self-Check results: All checked/passed.

Additional context I'm the developer of the app in question, so please feel free to reach out if you have any questions.

ghost commented 3 years ago

0.2.11 is quite out of date, can you get them to check if this happens on 0.2.17?

arashpayan commented 3 years ago

Hi Ammako. I'll see if they can upgrade and try to reproduce it again.

callahan22 commented 3 years ago

Hi,

I was the user that submitted the repro steps above. To confirm, I am running Calyx V2.2.0 on a Pixel 4XL which is running microG Service Core V0.2.17.204714-14 (5e4ccf0). MicroG self test results all come back ticked.

I did a new test this morning and tested the process I passed to Arash outlined above but without assigning a profile picture to the Zood account. It looks like it still crashes so the assignment of a profile image is not connected to the crash. At the time I was testing, this seemed to be connected. Apologies on the bad info. Zood/microG crashes the moment I share my location with a phone running Calyx/microG from any Google services enabled phone running Zood. In the case of testing, the 2 phones I used running Google Services were a Samsung S8 and a Samsung S6.

I'm more than happy to provide any debug logs you might need to resolve the issue, just drop me a line and let me know what you need.

dimaryaz commented 3 years ago

I may have repro'ed this bug (though wasn't following instructions exactly). I'm using (almost) the latest MicroG built from Git, on LineageOS 17.1.

I only have one phone, though, so it's a bit confusing - you can see different PIDs (17202, 17026) in the log.

02-16 10:02:32.878 16991 17026 I ZoodLoc : LocationSharingRevocation
02-16 10:02:32.899 16991 17026 I ZoodLoc : LocationSharingGrant
02-16 10:02:32.906 16991 17202 I ZoodLoc : onLocationSharingGranted
02-16 10:02:32.907 16991 17202 I ZoodLoc : onLocationSharingGranted: friend found. will watch
02-16 10:02:32.907 16991 17202 I ZoodLoc : onLocationSharingGranted
02-16 10:02:32.908 16991 17202 I ZoodLoc : onLocationSharingGranted: friend found. will watch
02-16 10:02:32.940 16991 17026 I ZoodLoc : handleAvatarUpdate for test567
02-16 10:02:32.941 16991 17026 I ZoodLoc : AvatarManager.saveAvatar for test567
02-16 10:02:32.971 16991 17202 E AndroidRuntime: FATAL EXCEPTION: pool-8-thread-4
02-16 10:02:32.971 16991 17202 E AndroidRuntime: Process: xyz.zood.george, PID: 16991
02-16 10:02:32.971 16991 17202 E AndroidRuntime: java.lang.NullPointerException: IBitmapDescriptorFactory is not initialized
02-16 10:02:32.971 16991 17202 E AndroidRuntime:    at com.google.android.gms.common.internal.Preconditions.checkNotNull(com.google.android.gms:play-services-basement@@17.3.0:11)
02-16 10:02:32.971 16991 17202 E AndroidRuntime:    at com.google.android.gms.maps.model.BitmapDescriptorFactory.zzg(Unknown Source:2)
02-16 10:02:32.971 16991 17202 E AndroidRuntime:    at com.google.android.gms.maps.model.BitmapDescriptorFactory.fromBitmap(Unknown Source:25)
02-16 10:02:32.971 16991 17202 E AndroidRuntime:    at io.pijun.george.view.AvatarRenderer.getBitmapDescriptor(AvatarRenderer.java:120)
02-16 10:02:32.971 16991 17202 E AndroidRuntime:    at xyz.zood.george.MainFragment$24$1.run(MainFragment.java:1170)
02-16 10:02:32.971 16991 17202 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
02-16 10:02:32.971 16991 17202 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
02-16 10:02:32.971 16991 17202 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:919)
02-16 10:02:32.974  1062 17205 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
02-16 10:02:32.974  1062  3430 W ActivityTaskManager:   Force finishing activity xyz.zood.george/.MainActivity
02-16 10:02:32.982  1062  1081 I ActivityManager: Showing crash dialog for package xyz.zood.george u10
02-16 10:02:32.982  1062  1081 E system_server: Invalid ID 0x00000000.
arashpayan commented 3 years ago

@dimaryaz, it looks like you've found a second bug! :smile:

If the avatar being rendered on the map isn't a crucial part of the original bug, then the repro steps boil down to:

  1. Log in to Zood on a phone running microG
  2. Have any other phone running Zood share its location with the Zood account running on the microG phone.
  3. Keep Zood open on both phones.
  4. As soon as the microG phone receives a location update from the other phone, the app will crash.