Helium314 / SCEE

OpenStreetMap surveyor app for experienced OSM contributors
GNU General Public License v3.0
115 stars 8 forks source link

Crash on startup #461

Open awebeer256 opened 8 months ago

awebeer256 commented 8 months ago

Exactly what it says on the tin.

How to Reproduce Open the app…sometimes. I've had this version installed for almost three months and been using it a lot throughout that time, but I've only now experienced this problem for the first time.

Anyway: upon launch, I was immediately kicked back to my home screen. When I tried again to open the app, it prompted me to send an email with an auto-generated crash report.

Report ``` Describe how to reproduce it here: Thread: DefaultDispatcher-worker-3 App version: 53.32 Device: google panther, Android 14 Locale: en_CA Stack trace: java.util.ConcurrentModificationException at android.util.ArrayMap.put(arraymap.java:628) at com.mapzen.tangram.MapController.addDataLayer(mapcontroller.java:700) at de.westnordost.streetcomplete.screens.main.map.tangram.KtMapController.addDataLayer(KtMapController.kt:301) at de.westnordost.streetcomplete.screens.main.map.tangram.KtMapController.addDataLayer$default(KtMapController.kt:300) at de.westnordost.streetcomplete.screens.main.map.components.DownloadedAreaMapComponent.set(DownloadedAreaMapComponent.kt:19) at de.westnordost.streetcomplete.screens.main.map.DownloadedAreaManager$update$1.invokeSuspend(DownloadedAreaManager.kt:55) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at [kotlinx.coroutines.DispatchedTask.run](https://kotlinx.coroutines.dispatchedtask.run/)(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$[Worker.run](https://worker.run/)(CoroutineScheduler.kt:684) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@2c84a18, Dispatchers.Default] Last log before crash: 2023-10-14 05:24:58.514 I MainFragment: onAttach 2023-10-14 05:24:58.516 I MainFragment: onCreate 2023-10-14 05:24:58.527 I MainFragment: onCreateView 2023-10-14 05:24:58.558 I MainFragment: onViewCreated 2023-10-14 05:24:58.590 I MainFragment: onViewStateRestored 2023-10-14 05:24:58.606 I MainFragment: onStart (add listeners) 2023-10-14 05:24:58.636 I Preloader: Loaded country boundaries in 0.1s 2023-10-14 05:24:58.642 I MainFragment: onResume 2023-10-14 05:24:58.803 I Preloader: Loaded features dictionary in 0.3s 2023-10-14 05:24:58.803 I Preloader: Preloading data took 0.3s 2023-10-14 05:24:59.036 I MapDataCache: need to fetch data in [TilesRect(left=73032, top=95600, right=73039, bottom=95607)] from database Log warnings and errors: ```

Does it happen in normal StreetComplete? No idea, since it's evidently so rare.

Versions affected Android: GrapheneOS UP1A.231005.007.2023101100 SCEE: 53.32

chrisdebian commented 8 months ago

Seeing this, I looked to see what versions of SCEE I was running, and this version is crashing in startup, too.

` Thread: main App version: 54.11 Device: google oriole, Android 14 Locale: en_GB Stack trace: java.util.ConcurrentModificationException at android.util.ArrayMap.put(ArrayMap.java:628) at com.mapzen.tangram.MapController.addDataLayer(SourceFile:0) at de.westnordost.streetcomplete.screens.main.map.tangram.KtMapController.addDataLayer(Unknown Source:7) at de.westnordost.streetcomplete.screens.main.map.tangram.KtMapController.addDataLayer$default(Unknown Source:5) at de.westnordost.streetcomplete.screens.main.map.MainMapFragment$gpxLayer$2.invoke(SourceFile:0) at de.westnordost.streetcomplete.screens.main.map.MainMapFragment$gpxLayer$2.invoke(SourceFile:0) at kotlin.SynchronizedLazyImpl.getValue(Unknown Source:20) at de.westnordost.streetcomplete.screens.main.map.MainMapFragment.getGpxLayer(Unknown Source:2) at de.westnordost.streetcomplete.screens.main.map.MainMapFragment.loadGpxTrack(Unknown Source:0) at de.westnordost.streetcomplete.screens.main.map.MainMapFragment.onMapReady(Unknown Source:320) at de.westnordost.streetcomplete.screens.main.map.MapFragment.initMap(Unknown Source:277) at de.westnordost.streetcomplete.screens.main.map.MapFragment.access$initMap(Unknown Source:0) at de.westnordost.streetcomplete.screens.main.map.MapFragment$initMap$1.invokeSuspend(Unknown Source:11) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:11) at kotlinx.coroutines.DispatchedTaskKt.resume(Unknown Source:60) at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(Unknown Source:24) at kotlinx.coroutines.DispatchedTaskKt.dispatch(Unknown Source:47) at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(Unknown Source:7) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(Unknown Source:33) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(Unknown Source:7) at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(Unknown Source:10) at de.westnordost.streetcomplete.screens.main.map.tangram.KtMapController.init$lambda$0(Unknown Source:47) at de.westnordost.streetcomplete.screens.main.map.tangram.KtMapController.$r8$lambda$6edekNZnXs_wkJ6MaCatQm6SVhk(SourceFile:0) at de.westnordost.streetcomplete.screens.main.map.tangram.KtMapController$$ExternalSyntheticLambda0.onSceneReady(SourceFile:0) at com.mapzen.tangram.MapController$9.run(Unknown Source:19) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8177) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@2b9196d, Dispatchers.Main.immediate]

    Last log before crash:
    2023-10-14 10:17:13.541 I Preloader: Loaded country boundaries in 2.2s

2023-10-14 10:17:16.961 I Preloader: Loaded features dictionary in 5.6s 2023-10-14 10:17:16.962 I Preloader: Preloading data took 5.7s 2023-10-14 10:21:21.747 I Cleaner: Cleaning took 0.6s 2023-10-14 10:58:40.164 I MainFragment: onAttach 2023-10-14 10:58:40.166 I MainFragment: onCreate 2023-10-14 10:58:40.176 I MainFragment: onCreateView 2023-10-14 10:58:40.191 I MainFragment: onViewCreated 2023-10-14 10:58:40.240 I MainFragment: onViewStateRestored 2023-10-14 10:58:40.244 I MainFragment: onStart (add listeners) 2023-10-14 10:58:40.267 I MainFragment: onResume

    Log warnings and errors:

`

Thanks,

Chris

Helium314 commented 8 months ago

@awebeer256's crash in DownloadedAreaMapComponent might be fixed in 54.11. But @chrisdebian's crash obviously is current. Unfortunately the log contains a lot of "Unknown Source", which might be a side effect of some changed ProGuard settings coming with a recent Gradle upgrade (which also caused the crashes in 54.1).

@chrisdebian is it happening on every start, and do you use the GPX track functionality?

chrisdebian commented 8 months ago

Hi, all.

I can confirm that this appears to happen occasionally, and I can open the app and use it, this morning. I haven't used the GPX Track functionality (I don't think).

Thanks,

Chris

Helium314 commented 8 months ago

I just released v54.12, which should fix the "Unknown Source" in stack trace. @chrisdebian could you provide a log taken with this version if the crash occurs again?

chrisdebian commented 8 months ago

Hi, will do. New version seems to be launching fine, though.

Thanks,

Chris

Aircan commented 7 months ago

I can confirm crashes on startup. GrapheneOS, too. SCEE v55 from F Droid.

Crash log:

type: crash
osVersion: google/lynx/lynx:14/UP1A.231105.003/2023111500:user/release-keys
package: de.westnordost.streetcomplete.expert:5500
process: de.westnordost.streetcomplete.expert
processUptime: 691 + 301 ms
installer: com.looker.droidify

java.lang.NullPointerException
    at de.westnordost.streetcomplete.data.osm.edits.MapDataWithEditsSource.modifyBBoxMapData(MapDataWithEditsSource.kt:422)
    at de.westnordost.streetcomplete.data.osm.edits.MapDataWithEditsSource.getMapDataWithGeometry(MapDataWithEditsSource.kt:250)
    at de.westnordost.streetcomplete.screens.main.map.StyleableOverlayManager.fetchAndCache(StyleableOverlayManager.kt:112)
    at de.westnordost.streetcomplete.screens.main.map.StyleableOverlayManager.getFromCache(StyleableOverlayManager.kt:79)
    at de.westnordost.streetcomplete.screens.main.map.StyleableOverlayManager.access$getFromCache(StyleableOverlayManager.kt:43)
    at de.westnordost.streetcomplete.screens.main.map.StyleableOverlayManager$onNewTilesRect$1.invokeSuspend(StyleableOverlayManager.kt:224)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@c28f185, Dispatchers.IO]
Helium314 commented 7 months ago

@Aircan That stacktrace is completely different from the others (not a ConcurrentModificationException when calling KtMapController.addDataLayer) I've had a crash like this previously, but without any way of identifying which edit caused this the isn't much I can do.

Aircan commented 7 months ago

Well, this is the one being displayed right after the crash when hitting "show details". How to provide more helpful information?

The app is not usable right now.

Helium314 commented 7 months ago

The issue is with rebuilding the local edits on your device (the ones that haven't been uploaded).

Do you know whether you had any such edits that change way geometry? Like split way, insertet a node into a way, move a node that is part of a way, or a revert of any such edit.

Helium314 commented 7 months ago

I can think of some ways how the app should start again:

Aircan commented 7 months ago

Yes, I did split ways.

W.r.t. your 2nd post: How to change the configuration, if I am not able to open the app at all?

Helium314 commented 7 months ago

How to change the configuration, if I am not able to open the app at all?

You need to manually edit the shared preferences (/data/data/de.westnordost.streetcomplete.expert/shared_prefs/de.westnordost.streetcomplete.expert_preferences.xml). Just delete the line containing selectedOverlay.

Does opening a geo uri help?

Yes, I did split ways.

Alright, so no moved nodes... then unfortunately the new 55.11 release will not help.

Aircan commented 7 months ago

After 55.1 upgrade: Same issue. Has been solved by uninstall and reinstall. Works now. Issue can be closed. Thank you.