organicmaps / organicmaps

🍃 Organic Maps is a free Android & iOS offline maps app for travelers, tourists, hikers, and cyclists. It uses crowd-sourced OpenStreetMap data and is developed with love by MapsWithMe (MapsMe) founders and our community. No ads, no tracking, no data collection, no crapware. Please donate to support the development!
https://organicmaps.app
Apache License 2.0
10.07k stars 963 forks source link

App crashes when zooming too much inside a city boundary #5097

Closed kidhanis closed 1 year ago

kidhanis commented 1 year ago

Describe the issue A crash occurs only when I'm at zoom levels near ground in San Juan, Puerto Rico. Zooming in right over the city or zooming in outside the city to then try to hover over San Juan causes the app to crash and close itself, taking me back to my home screen. I already deleted and re-downloaded the map of Puerto Rico and the crash still happens.

Steps to reproduce

  1. Download map of Puerto Rico. Coordinates of San Juan in OSM are 18.4652990, -66.1166660.
  2. Zoom in anywhere over San Juan as defined by the OSM boundary relation 4468264.
  3. With enough zoom, the app crashes.

Expected behavior I can zoom as much as I like over San Juan without any crashes.

Screenshots

Screenshots over Laguna San José (18.425227, -66.023828) The first screenshot looks normal ![Normal](https://user-images.githubusercontent.com/5599578/236647650-bb82f0ec-13aa-45f2-b503-0607382620a5.jpg) The second is zoomed in a bit more and you can see the gray, building-like color over San Juan while Carolina, the neighboring city, looks normal. ![GrayColor](https://user-images.githubusercontent.com/5599578/236647647-d37f20c9-9bf0-412b-98bc-567be69ffd6b.jpg) The third screenshot is with more zoom and look weirder. A bit more zoom and the app would crash. ![WeirdLines](https://user-images.githubusercontent.com/5599578/236647652-52ad0a64-7dc8-4bcb-bbda-029a3148ea8f.jpg)

System information:

Additional context This might be related to OSM changeset 134239621 from 2023-03-28, where the type of the San Juan relation was accidentally modified from boundary to multipolygon and was later corrected on 2023-04-10.

biodranik commented 1 year ago
  1. Do you have SD card? If yes, do you store maps on SD? It can be checked in OM settings. Sometimes non-working or slow SD cards lead to strange crashes.
  2. Did you test the latest beta with new map data? https://cdn.organicmaps.app/apk/OrganicMaps-23050505-fdroid-beta.apk
kidhanis commented 1 year ago
  1. No, I don't have an SD card
  2. On that beta, there's no crash and the map looks fine at any zoom level
kidhanis commented 1 year ago

San Juan is fine now, but I tried looking around for other examples with the most recent map data from 2023-06-02 in version 2023.06.04-13-FDroid.

I found only one other area that can crash the app under similar circumstances. It has to do with relation 15597971, which had a building=yes tag added on 2023-05-17 and removed on 2023-06-03, so I suppose that the next update will once again fix this crash.

Steps to reproduce

  1. Download map data for Canada-Quebec-Rimouski.
  2. Search for "Gaspe Peninsula". Select the result that shows up so that the app zooms in automatically.
  3. After the automatic zoom, the map turns gray, like the color of a building. This might take a few seconds to render. Afterwards, the app crashes.
  4. If the map didn't turn gray, try zooming in more and panning around, or look for a city inside the relation to see if this triggers the rendering.
biodranik commented 1 year ago

Thank you very much for details! Crash easily reproduces in release, and not as easy in debug:

06-10 09:52:27.883 24739  7748 E OMcore  : drape/batcher_helpers.cpp:372 BatchData(): CHECK(IsEnoughMemory(avVertex, vertexCount, avIndex, indexCount)) 5000 19998 5000 47018
06-10 09:52:27.883 24739  7748 F libc    : /Users/alex/Developer/omim/omim/drape/batcher_helpers.cpp:372: virtual void dp::LineRawBatch::BatchData(ref_ptr<dp::GraphicsContext>, ref_ptr<dp::AttributeProvider>): assertion "false" failed
06-10 09:52:27.884 24739  7748 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 7748 (Thread-14), pid 24739 (ganicmaps.debug)

@vng is it caused by a too-big polygon? What would be the best way to prevent crashes like this one?