maplibre / maplibre-native

MapLibre Native - Interactive vector tile maps for iOS, Android and other platforms.
https://maplibre.org
BSD 2-Clause "Simplified" License
888 stars 273 forks source link

Crash app when loading mbtiles #2558

Open PaulLabat opened 1 week ago

PaulLabat commented 1 week ago

Describe the bug The app crash when loading an mbtiles file. It seems that the file is corrupted.

To Reproduce 1.Display an mbtiles files

  1. it crashes
  2. Below the crash log
2024-06-26 16:10:53.697 18672-18745 libc++abi               com.android.sample               E  terminating with uncaught exception of type mapbox::sqlite::Exception: database disk image is malformed
2024-06-26 16:10:53.698 18672-18745 libc                    com.android.sample               A  Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 18745 (MBTilesFileSour), pid 18672 (rot.sample)
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  Build fingerprint: 'samsung/gtactive5xeea/gtactive5:14/UP1A.231005.007/X306BXXS1AXC4:user/release-keys'
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  Revision: '4'
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  ABI: 'arm64'
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  Processor: '7'
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  Timestamp: 2024-06-26 16:10:53.832987585+0200
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  Process uptime: 11s
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  Cmdline: com.android.sample
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  pid: 18672, tid: 18745, name: MBTilesFileSour  >>> com.android.sample <<<
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  uid: 10332
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A  Abort message: 'terminating with uncaught exception of type mapbox::sqlite::Exception: database disk image is malformed'
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A      x0  0000000000000000  x1  0000000000004939  x2  0000000000000006  x3  0000006d801d2fa0
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A      x4  736f646277641f73  x5  736f646277641f73  x6  736f646277641f73  x7  7f7f7f7f7f7f7f7f
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A      x8  00000000000000f0  x9  000000710f248150  x10 0000000000000001  x11 000000710f29b1b0
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A      x12 0000007119f92020  x13 000000007fffffff  x14 0000000000806cf6  x15 000004a6bf17cf41
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A      x16 000000710f308d08  x17 000000710f2dd070  x18 0000006beb97a000  x19 00000000000048f0
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A      x20 0000000000004939  x21 00000000ffffffff  x22 0000006d801d30d0  x23 0000006d801d3110
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A      x24 0000006d801d31f0  x25 0000006d801d3138  x26 0000000000000001  x27 7fffffffffffffff
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A      x28 0000006bf34b08a8  x29 0000006d801d3020
2024-06-26 16:10:54.261 18855-18855 DEBUG                   crash_dump64                         A      lr  000000710f28cb0c  sp  0000006d801d2f80  pc  000000710f28cb38  pst 0000000000001000
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A  18 total frames
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A  backtrace:
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #00 pc 0000000000066b38  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 97f8621d2a4b9ffed8f5196d93a8a78e)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #01 pc 00000000009cd0d0  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #02 pc 00000000009cd2fc  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #03 pc 00000000009cd188  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #04 pc 00000000009cc728  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #05 pc 00000000009cc680  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (__cxa_throw+124) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #06 pc 000000000088cf40  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #07 pc 0000000000867644  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #08 pc 000000000086e72c  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #09 pc 00000000005375a8  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #10 pc 0000000000538590  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #11 pc 000000000084ae18  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #12 pc 000000000084a1e0  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #13 pc 000000000084a028  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #14 pc 000000000086d9b8  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #15 pc 000000000086d804  /data/app/~~4S0Ai5Xf6s3rR6m_eJPGcA==/com.android.sample-nGf-Q5LrlsJ23WGfRx80Hg==/base.apk!libmaplibre.so (offset 0x137da000) (BuildId: 52946ca4b0b526e6cc37dc4b34587e4fb012eb10)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #16 pc 00000000000cb888  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: 97f8621d2a4b9ffed8f5196d93a8a78e)
2024-06-26 16:10:54.262 18855-18855 DEBUG                   crash_dump64                         A        #17 pc 0000000000068370  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 97f8621d2a4b9ffed8f5196d93a8a78e)

Expected behavior Not to crash. If there is a way for the app to be notified that there is an error in this file that would be great !

Platform information (please complete the following information):

Additional context The file was copied to the device from a PC. Maybe it was corrupted during the copy.

louwers commented 1 week ago

If SQLite says it's malformed, we have to assume that is the case. Closing because not a bug.

PaulLabat commented 1 week ago

Isn't there a way to prevent the app from crashing ?

louwers commented 1 week ago

Right, it probably shouldn't.

Can you share the .mbtiles file?

PaulLabat commented 1 week ago

I cannot share with you the exact file. But I managed to corrupt another one that cause the same issue. corrupted.mbtiles.zip

louwers commented 1 week ago

Thank you!