tangrams / tangram-es

2D and 3D map renderer using OpenGL ES
MIT License
826 stars 238 forks source link

Crash in StreetComplete (modified version) #2292

Open Helium314 opened 3 years ago

Helium314 commented 3 years ago

TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:

Use my personal fork of StreetComplete: https://github.com/Helium314/StreetComplete/tree/my_modifications. Add a note via the menu option when long clicking somewhere on the map. Add note as GPX note (functionality not contained in original StreetComplete)

RESULT:

Usually the created note is written to a .gpx file. Sometimes the app crashes (this is very rare, I would estimate much less than 1% of all such notes) The note is still added to the file, so the crash likely happens after writing the file.

EXPECTED RESULT:

Note is written without a crash.

ENVIRONMENT:

Android 9 / LineageOS 16 Samsung S4 mini plus (9195I) App version as linked above

OTHER:

I thought I did something bad with one of my modifications, but according to https://github.com/streetcomplete/StreetComplete/issues/3293#issuecomment-922520346 tangram should not crash.

Log ``` 09-19 19:41:25.834 9196 12707 D Tangram : WARNING sceneLoader.cpp:687: Can't find data source streetcomplete_selected_pins for layer streetcomplete_selected_pins 09-19 19:41:25.834 9196 12707 D Tangram : WARNING sceneLoader.cpp:687: Can't find data source streetcomplete_pins for layer streetcomplete_pins 09-19 19:41:25.834 9196 12707 D Tangram : WARNING sceneLoader.cpp:687: Can't find data source streetcomplete_geometry for layer streetcomplete_geometry 09-19 19:41:25.834 9196 12707 D Tangram : WARNING sceneLoader.cpp:687: Can't find data source streetcomplete_quests_geometry for layer streetcomplete_quests_geometry 09-19 19:41:25.834 9196 12707 D Tangram : WARNING tileManager.cpp:204: add source jawg 09-19 19:41:25.835 9196 12708 D Tangram : TANGRAM scene.cpp:312: Prefetch tiles for View: 540.000000x960.000000 / zoom:19.500000 lon:xx.412769 lat:xx.217515 09-19 19:41:25.845 9196 12707 D Tangram : TANGRAM scene.cpp:427: Fetch texture asset:///map_theme/jawg/images/oneway_arrow@2x.png 09-19 19:41:25.845 9196 12707 D Tangram : TANGRAM scene.cpp:427: Fetch texture asset:///map_theme/jawg/images/pin_dot@2x.png 09-19 19:41:25.845 9196 12707 D Tangram : TANGRAM scene.cpp:427: Fetch texture file:///data/user/0/de.westnordost.streetcomplete.h3/files/pins.png 09-19 19:41:25.845 9196 12706 D Tangram : TANGRAM scene.cpp:432: Received texture asset:///map_theme/jawg/images/oneway_arrow@2x.png 09-19 19:41:25.846 9196 12706 D Tangram : WARNING texture.cpp:172: OpenGL ES doesn't support texture repeat wrapping for NPOT textures nor mipmap textures 09-19 19:41:25.846 9196 12706 D Tangram : WARNING texture.cpp:173: Falling back to LINEAR Filtering 09-19 19:41:25.846 9196 12706 D Tangram : TANGRAM scene.cpp:432: Received texture asset:///map_theme/jawg/images/pin_dot@2x.png 09-19 19:41:25.848 9196 12706 D Tangram : TANGRAM scene.cpp:432: Received texture file:///data/user/0/de.westnordost.streetcomplete.h3/files/pins.png 09-19 19:41:25.949 9196 12706 D Tangram : WARNING texture.cpp:172: OpenGL ES doesn't support texture repeat wrapping for NPOT textures nor mipmap textures 09-19 19:41:25.950 9196 12706 D Tangram : WARNING texture.cpp:173: Falling back to LINEAR Filtering 09-19 19:41:25.950 9196 12708 D Tangram : TANGRAM scene.cpp:312: Prefetch tiles for View: 540.000000x960.000000 / zoom:19.500000 lon:xx.412769 lat:xx.217515 09-19 19:41:25.963 9196 12707 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1 in tid 12707 (Thread-168), pid 9196 (reetcomplete.h3) 09-19 19:41:26.070 2727 2861 W GooglePlayServicesUtil: Google Play Store is missing. 09-19 19:41:26.097 4699 4714 I cing:persisten: Background concurrent copying GC freed 30176(1032KB) AllocSpace objects, 0(0B) LOS objects, 24% free, 3MB/4MB, paused 347us total 231.015ms 09-19 19:41:26.126 14313 14313 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone 09-19 19:41:26.136 429 429 I /system/bin/tombstoned: received crash request for pid 12707 09-19 19:41:26.143 14313 14313 I crash_dump32: performing dump of process 9196 (target tid = 12707) 09-19 19:41:26.195 14313 14313 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 09-19 19:41:26.195 14313 14313 F DEBUG : LineageOS Version: '16.0-20210812-UNOFFICIAL-serranovelte' 09-19 19:41:26.195 14313 14313 F DEBUG : Build fingerprint: 'samsung/serranovelte/serranovelte:.9/PQ3A.190801.002/:userdebug/,release-keys' 09-19 19:41:26.195 14313 14313 F DEBUG : Revision: '0' 09-19 19:41:26.195 14313 14313 F DEBUG : ABI: 'arm' 09-19 19:41:26.195 14313 14313 F DEBUG : pid: 9196, tid: 12707, name: Thread-168 >>> de.westnordost.streetcomplete.h3 <<< 09-19 19:41:26.196 14313 14313 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1 09-19 19:41:26.196 14313 14313 F DEBUG : Cause: null pointer dereference 09-19 19:41:26.196 14313 14313 F DEBUG : r0 00000001 r1 97088ed9 r2 ffffffff r3 00000000 09-19 19:41:26.196 14313 14313 F DEBUG : r4 92b83ec8 r5 ab96a954 r6 92616584 r7 93f01760 09-19 19:41:26.196 14313 14313 F DEBUG : r8 97593e08 r9 97c8c680 r10 93f018f8 r11 93f01900 09-19 19:41:26.196 14313 14313 F DEBUG : ip b3d2f630 sp 93f01758 lr 97088f01 pc 970529fa 09-19 19:41:26.230 14313 14313 F DEBUG : 09-19 19:41:26.230 14313 14313 F DEBUG : backtrace: 09-19 19:41:26.230 14313 14313 F DEBUG : #00 pc 000239fa /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.230 14313 14313 F DEBUG : #01 pc 00059efd /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.231 14313 14313 F DEBUG : #02 pc 00026bd7 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.232 14313 14313 F DEBUG : #03 pc 00059e87 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.232 14313 14313 F DEBUG : #04 pc 00059dd1 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.232 14313 14313 F DEBUG : #05 pc 000c4f11 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.232 14313 14313 F DEBUG : #06 pc 00026bd7 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.232 14313 14313 F DEBUG : #07 pc 000834e1 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.233 14313 14313 F DEBUG : #08 pc 0008434b /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.233 14313 14313 F DEBUG : #09 pc 00084327 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.233 14313 14313 F DEBUG : #10 pc 000c4117 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.233 14313 14313 F DEBUG : #11 pc 00026bd7 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.233 14313 14313 F DEBUG : #12 pc 000717e7 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.234 14313 14313 F DEBUG : #13 pc 00084399 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.234 14313 14313 F DEBUG : #14 pc 00084381 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.234 14313 14313 F DEBUG : #15 pc 0008435d /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.234 14313 14313 F DEBUG : #16 pc 00083171 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.234 14313 14313 F DEBUG : #17 pc 000842a7 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.234 14313 14313 F DEBUG : #18 pc 000842d5 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.235 14313 14313 F DEBUG : #19 pc 00056875 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.235 14313 14313 F DEBUG : #20 pc 00056971 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.235 14313 14313 F DEBUG : #21 pc 0002996d /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.235 14313 14313 F DEBUG : #22 pc 00026bd7 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.235 14313 14313 F DEBUG : #23 pc 0002796b /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.235 14313 14313 F DEBUG : #24 pc 00029cf3 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.235 14313 14313 F DEBUG : #25 pc 00022765 /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.235 14313 14313 F DEBUG : #26 pc 00022a3f /data/app/de.westnordost.streetcomplete.h3-is4OluM8_HVEDEiYz3mnbQ==/lib/arm/libtangram.so 09-19 19:41:26.236 14313 14313 F DEBUG : #27 pc 00064089 /system/lib/libc.so (__pthread_start(void*)+22) 09-19 19:41:26.236 14313 14313 F DEBUG : #28 pc 0001deed /system/lib/libc.so (__start_thread+24) ```
westnordost commented 3 years ago

You can't expect that the maintainers of this library will download your app and try 100+ times the reproduction until they can reproduce it.

You should explain what exactly "adding a GPX note" consists of. How does it interact with the tangram-es library? What function(s) are called exactly? Or does it send the app to the background? If you are in-app, why does the log look like the tangram-es library has just been initialized?

Helium314 commented 3 years ago

You can't expect that the maintainers of this library will download your app and try 100+ times the reproduction until they can reproduce it.

A log is already added. What would they gain except some other time and device name in the log?

You should explain what exactly "adding a GPX note" consists of.

Almost exactly the same things as adding a note. https://github.com/Helium314/StreetComplete/blob/my_modifications/app/src/main/java/de/westnordost/streetcomplete/map/MainFragment.kt#L485 is a normal note https://github.com/Helium314/StreetComplete/blob/my_modifications/app/src/main/java/de/westnordost/streetcomplete/map/MainFragment.kt#L502 is a GPX note

The difference is that GPX note writes to a file, while normal note calls lifecycleScope.launch { questController.createNote(note, imagePaths, position) } And I just noticed closeBottomSheet() is calles twice on a GPX note. Could that kill tangram? If not, the crash may also happen with normal notes. But I barely use them, so there is little opportunity to crash.

How does it interact with the tangram-es library?

No idea. I don't know what parts of SC interact with tangram.

What function(s) are called exactly? Or does it send the app to the background?

Nothing is done in background. Functions are in https://github.com/Helium314/StreetComplete/blob/my_modifications/app/src/main/java/de/westnordost/streetcomplete/map/MainFragment.kt#L519 Mainly: File.createNewFile, File.readText, File.writeText

If you are in-app, why does the log look like the tangram-es library has just been initialized?

No idea.

westnordost commented 3 years ago

How does it interact with the tangram-es library?

No idea. I don't know what parts of SC interact with tangram.

Well, then I suggest you close this ticket again because it is not actionable for tangram maintainers.

Edit: Unless the tombstone posted in the log can hint to something. I don't have expertise there.

Helium314 commented 3 years ago

I'll leave it to the maintainers to close this if there is nothing useful in the logs. The bug itself doesn't bother me and apparently doesn't appear for anyone else.