cgeo / cgeo

c:geo - The powerful Android geocaching app.
www.cgeo.org
Apache License 2.0
1.39k stars 566 forks source link

c:geo crashing with SecurityException on opening cache details #11558

Closed moving-bits closed 2 years ago

moving-bits commented 3 years ago

Describe your problem!

From support email:

My cgeo crashes every time I try to read cache details. Map shows position and when I click on cache it comes up ok but when I press More Details it seems to lose connection as it goes back to start and i can see it saying logging on Tried reinstalling no joy.

Logfile contains several errors like the following:

08-25 16:32:40.891 29106 29106 E AndroidRuntime: FATAL EXCEPTION: main
08-25 16:32:40.891 29106 29106 E AndroidRuntime: Process: cgeo.geocaching, PID: 29106
08-25 16:32:40.891 29106 29106 E AndroidRuntime: java.lang.SecurityException: UID 10227 does not have permission to content://com.android.chrome.FileProvider/images/screenshot/16296492294022962545429846031329.jpg [user 0]
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at android.os.Parcel.createException(Parcel.java:1966)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at android.os.Parcel.readException(Parcel.java:1934)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at android.os.Parcel.readException(Parcel.java:1884)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at android.content.IClipboard$Stub$Proxy.getPrimaryClip(IClipboard.java:225)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at android.content.ClipboardManager.getPrimaryClip(ClipboardManager.java:170)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at android.content.ClipboardManager.getText(ClipboardManager.java:264)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at cgeo.geocaching.utils.ClipboardUtils.getText(ClipboardUtils.java:46)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at cgeo.geocaching.models.Waypoint.hasClipboardWaypoint(Waypoint.java:466)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at cgeo.geocaching.CacheDetailActivity$WaypointsViewCreator.setClipboardButtonVisibility(CacheDetailActivity.java:1937)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at cgeo.geocaching.CacheDetailActivity$WaypointsViewCreator.setContent(CacheDetailActivity.java:2022)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at cgeo.geocaching.activity.TabbedViewPagerFragment.notifyDataSetChanged(TabbedViewPagerFragment.java:61)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at cgeo.geocaching.activity.TabbedViewPagerActivity.setOrderedPages(TabbedViewPagerActivity.java:110)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at cgeo.geocaching.CacheDetailActivity.notifyDataSetChanged(CacheDetailActivity.java:908)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at cgeo.geocaching.CacheDetailActivity.access$300(CacheDetailActivity.java:182)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at cgeo.geocaching.CacheDetailActivity$LoadCacheHandler.handleRegularMessage(CacheDetailActivity.java:860)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at cgeo.geocaching.utils.DisposableHandler.handleMessage(DisposableHandler.java:59)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:106)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:214)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7073)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
08-25 16:32:40.891 29106 29106 E AndroidRuntime: Caused by: android.os.RemoteException: Remote stack trace:
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at com.android.server.am.ActivityManagerService.checkGrantUriPermissionLocked(ActivityManagerService.java:12705)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at com.android.server.am.ActivityManagerService.grantUriPermissionLocked(ActivityManagerService.java:12771)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at com.android.server.am.ActivityManagerService.grantUriPermissionFromOwner(ActivityManagerService.java:13209)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at com.android.server.clipboard.ClipboardService.grantUriLocked(ClipboardService.java:830)
08-25 16:32:40.891 29106 29106 E AndroidRuntime:    at com.android.server.clipboard.ClipboardService.grantItemLocked(ClipboardService.java:845)

User claims that after putting a new SD card into the phone the error vanished.

Anyway - Does someone have an idea what's happening here?

How to reproduce?

Actual result after these steps?

crash, c:geo restarts (main screen, logging in)

Expected result after these steps?

no crash, but cache details opening

Reproducible

Unclear

c:geo Version

2021.08.15

System information

## System information

c:geo version: 2021.08.15

Device:
-------
- Device type: SM-G950U (dreamqltesq, samsung)
- Available processors: 8
- Android version: 9
- Android build: PPR1.180610.011.G950USQU8DUD3
- Screen resolution: 1080x2076px (360x668dp)
- Sailfish OS detected: false
- Google Play services: enabled - 21.26.21 (100408-387928701)
- HW acceleration: enabled (default state)

Sensor and location:
-------
- Low power mode: inactive
- Compass capabilities: yes
- Rotation vector sensor: present
- Orientation sensor: present
- Magnetometer & Accelerometer sensor: present
- Direction sensor used: rotation vector

Program settings:
-------
- Settings: v8, Count:28
- Set language: en_US (system default)
- System date format: M/d/yy
- Time zone: GMT+01:00
- Debug mode active: no
- Last backup: never
- Routing mode: Walk
- Live map mode: true
- OSM multi-threading: false / threads: 1
- Map: OpenStreetMap.org
  - Id: cgeo.geocaching.maps.mapsforge.MapsforgeMapProvider$OsmMapSource
  - Atts: OpenStreetMap DE, map data OpenStreetMap contributors
  - Theme: none

Filters:
-------
- Hide waypoints: -
- LIVE: None ([:inconclusive=false:advanced=false])
- OFFLINE: None ([:inconclusive=false:advanced=false])

Services:
-------
- Geocaching sites enabled:
   geocaching.com: Logged in (Login OK) / PREMIUM
   Geocaching.com Adventure Lab
- Geocaching.com date format: M/d/yyyy
- Routing: internal / BRouter installed: false
- Installed c:geo plugins:  none

Permissions & paths:
-------
- Fine location permission: granted
- Write external storage permission: granted
- System internal c:geo dir: /data/user/0/cgeo.geocaching (44.6 GB free) v2 internal isDir(6 entries)
- Legacy User storage c:geo dir: /storage/emulated/0/cgeo (44.6 GB free) v2 external non-removable isDir(7 entries)
- Geocache data: /storage/emulated/0/Android/data/cgeo.geocaching/files/GeocacheData (44.6 GB free) v2 external non-removable isDir(7 entries)
- Internal theme sync (is turned off): /data/user/0/cgeo.geocaching/MapThemeData (44.6 GB free) v2 internal isDir(0 entries)
- Public Folders: #11
  - BASE: /cgeo (User-Defined)[/cgeo[DOCUMENT#0:p-content://com.android.externalstorage.documents/tree/primary%3Acgeo::]] (Uri: content://com.android.externalstorage.documents/tree/primary%3Acgeo/document/primary%3Acgeo, Av:true, files:>=11, dirs:>=9, totalFileSize:>=1011.5 MB, free space: 44.6 GB, files on device: 1765376)
  - OFFLINE_MAPS: /cgeo/maps (Default)[/cgeo/maps[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/primary%3Acgeo::/maps]] (Uri: content://com.android.externalstorage.documents/tree/primary%3Acgeo/document/primary%3Acgeo%2Fmaps, Av:true, files:2, dirs:1, totalFileSize:1011.0 MB, free space: 44.6 GB, files on device: 1765376)
  - OFFLINE_MAP_THEMES: /cgeo/maps/_themes (Default)[/cgeo/maps/_themes[PERSISTABLE_FOLDER(OFFLINE_MAPS)#1:p-content://com.android.externalstorage.documents/tree/primary%3Acgeo::/maps/_themes]] (Uri: content://com.android.externalstorage.documents/tree/primary%3Acgeo/document/primary%3Acgeo%2Fmaps%2F_themes, Av:true, files:0, dirs:0, totalFileSize:0 B, free space: 44.6 GB, files on device: 1765376)
  - LOGFILES: /cgeo/logfiles (Default)[/cgeo/logfiles[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/primary%3Acgeo::/logfiles]] (Uri: content://com.android.externalstorage.documents/tree/primary%3Acgeo/document/primary%3Acgeo%2Flogfiles, Av:true, files:2, dirs:0, totalFileSize:414.8 KB, free space: 44.6 GB, files on device: 1765376)
  - GPX: /cgeo/gpx (Default)[/cgeo/gpx[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/primary%3Acgeo::/gpx]] (Uri: content://com.android.externalstorage.documents/tree/primary%3Acgeo/document/primary%3Acgeo%2Fgpx, Av:true, files:0, dirs:0, totalFileSize:0 B, free space: 44.6 GB, files on device: 1765376)
  - BACKUP: /cgeo/backup (Default)[/cgeo/backup[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/primary%3Acgeo::/backup]] (Uri: content://com.android.externalstorage.documents/tree/primary%3Acgeo/document/primary%3Acgeo%2Fbackup, Av:true, files:0, dirs:0, totalFileSize:0 B, free space: 44.6 GB, files on device: 1765376)
  - FIELD_NOTES: /cgeo/field-notes (Default)[/cgeo/field-notes[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/primary%3Acgeo::/field-notes]] (Uri: content://com.android.externalstorage.documents/tree/primary%3Acgeo/document/primary%3Acgeo%2Ffield-notes, Av:true, files:0, dirs:0, totalFileSize:0 B, free space: 44.6 GB, files on device: 1765376)
  - SPOILER_IMAGES: /cgeo/GeocachePhotos (Default)[/cgeo/GeocachePhotos[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/primary%3Acgeo::/GeocachePhotos]] (Uri: content://com.android.externalstorage.documents/tree/primary%3Acgeo/document/primary%3Acgeo%2FGeocachePhotos, Av:true, files:0, dirs:0, totalFileSize:0 B, free space: 44.6 GB, files on device: 1765376)
  - ROUTING_BASE: /cgeo/routing (Default)[/cgeo/routing[PERSISTABLE_FOLDER(BASE)#1:p-content://com.android.externalstorage.documents/tree/primary%3Acgeo::/routing]] (Uri: content://com.android.externalstorage.documents/tree/primary%3Acgeo/document/primary%3Acgeo%2Frouting, Av:true, files:7, dirs:1, totalFileSize:81.2 KB, free space: 44.6 GB, files on device: 1765376)
  - ROUTING_TILES: /cgeo/routing/segments4 (Default)[/cgeo/routing/segments4[PERSISTABLE_FOLDER(ROUTING_BASE)#1:p-content://com.android.externalstorage.documents/tree/primary%3Acgeo::/routing/segments4]] (Uri: content://com.android.externalstorage.documents/tree/primary%3Acgeo/document/primary%3Acgeo%2Frouting%2Fsegments4, Av:true, files:0, dirs:0, totalFileSize:0 B, free space: 44.6 GB, files on device: 1765376)
  - TEST_FOLDER: [Legacy]/data/user/0/cgeo.geocaching/files/unittest (Default)[/data/user/0/cgeo.geocaching/files/unittest[FILE#1:p-file:///data/user/0/cgeo.geocaching/files::/unittest]] (Uri: file:///data/user/0/cgeo.geocaching/files/unittest, Av:true, files:0, dirs:0, totalFileSize:0 B, free space: 44.6 GB, files on device: -1)
- Map render theme path:
- PersistedDocumentUris: #1
- TRACK: null
- Persisted Uri Permissions: #1
  - content://com.android.externalstorage.documents/tree/primary%3Acgeo (Aug 24, 1:57 PM):RW
- Database: /data/user/0/cgeo.geocaching/databases/data (v96, Size:288.0 KB) on system internal storage

--- End of system information ---

Additional Information

ticket #577300

Lineflyer commented 2 years ago

@eddiemuc I tried looking for such stale issues like this one. I am unsure whether we just close here or if there is anything to follow up.

Looking at the crash above I really wonder we it tries to access some screenshot from c:geo. That shouldn't be any path or file c:geo tries to access by itself... It looks a bit like the user has this file in his clipboard?! Is this possible after all?

Do you see any shortcoming in c:geo or shall we just close?

eddiemuc commented 2 years ago

I have really no idea what lead to this issue, my speculation would be same as @Lineflyer s. I vote for closing here.