Crash on clearDatabase with Bravia TVs
When calling clearDatabase the medialibrary crashes on Bravia TVs.
I don't have any context on how users crash, but I was able to reproduce it by clearing the database in the settings, and clearing it again, while it was discovering. Adding a condition on vlc-android side not to start clearDatabase while the medialibrary is working stops it from happening, but it's a bandage.
2022-01-07 15:06:53.667 1144-1144/? E/hwcomposer: layer2 is surface, so hwc return false
2022-01-07 15:06:53.683 1144-1144/? E/hwcomposer: layer2 is surface, so hwc return false
2022-01-07 15:06:53.993 16934-16934/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2022-01-07 15:06:53.994 16934-16934/? A/DEBUG: Build fingerprint: 'Sony/SVP4KDTV15_EU/SVP-DTV15:7.0/NRD91N.S28/5.417:user/release-keys'
2022-01-07 15:06:53.994 16934-16934/? A/DEBUG: Revision: '0'
2022-01-07 15:06:53.994 16934-16934/? A/DEBUG: ABI: 'arm'
2022-01-07 15:06:53.994 16934-16934/? A/DEBUG: pid: 4076, tid: 6726, name: DefaultDispatch >>> org.videolan.vlc.debug <<<
2022-01-07 15:06:53.994 16934-16934/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2022-01-07 15:06:53.997 16934-16934/? A/DEBUG: Abort message: '/usr/local/google/buildbot/src/android/ndk-release-r21/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:72: abort_message: assertion "terminating with uncaught exception of type medialibrary::sqlite::errors::DatabaseBusy: Failed to run request [SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE '%#_%' ESCAPE '#']: database is locked(5)" failed'
2022-01-07 15:06:53.997 16934-16934/? A/DEBUG: r0 00000000 r1 00001a46 r2 00000006 r3 00000008
2022-01-07 15:06:53.997 16934-16934/? A/DEBUG: r4 81e7f978 r5 00000006 r6 81e7f920 r7 0000010c
2022-01-07 15:06:53.997 16934-16934/? A/DEBUG: r8 826e1778 r9 7f923500 sl 00000000 fp 81e7dc98
2022-01-07 15:06:53.997 16934-16934/? A/DEBUG: ip 00000000 sp 81e7d4d8 lr a59ef447 pc a59f1ca4 cpsr 200b0010
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: backtrace:
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #00 pc 00049ca4 /system/lib/libc.so (tgkill+12)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #01 pc 00047443 /system/lib/libc.so (pthread_kill+34)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #02 pc 0001d745 /system/lib/libc.so (raise+10)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #03 pc 00019291 /system/lib/libc.so (__libc_android_abort+34)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #04 pc 00017034 /system/lib/libc.so (abort+4)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #05 pc 0001b73f /system/lib/libc.so (__libc_fatal+22)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #06 pc 0001948b /system/lib/libc.so (__assert2+18)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #07 pc 000645cb /data/app/org.videolan.vlc.debug-1/lib/arm/libc++_shared.so
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #08 pc 00064745 /data/app/org.videolan.vlc.debug-1/lib/arm/libc++_shared.so
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #09 pc 0006bdf9 /data/app/org.videolan.vlc.debug-1/lib/arm/libc++_shared.so
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #10 pc 0006b6a7 /data/app/org.videolan.vlc.debug-1/lib/arm/libc++_shared.so
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #11 pc 0006b66f /data/app/org.videolan.vlc.debug-1/lib/arm/libc++_shared.so (__cxa_throw+74)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #12 pc 00217f9c /data/app/org.videolan.vlc.debug-1/lib/arm/libmla.so
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #13 pc 0022dc7c /data/app/org.videolan.vlc.debug-1/lib/arm/libmla.so (_ZN12medialibrary6sqlite9Statement3rowEv+292)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #14 pc 00227b18 /data/app/org.videolan.vlc.debug-1/lib/arm/libmla.so (_ZN12medialibrary6sqlite5Tools10listTablesEPNS0_10ConnectionE+136)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #15 pc 001fe194 /data/app/org.videolan.vlc.debug-1/lib/arm/libmla.so (_ZN12medialibrary12MediaLibrary15deleteAllTablesEPNS_6sqlite10ConnectionE+28)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #16 pc 0020303c /data/app/org.videolan.vlc.debug-1/lib/arm/libmla.so (_ZN12medialibrary12MediaLibrary16recreateDatabaseEv+56)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #17 pc 00215a64 /data/app/org.videolan.vlc.debug-1/lib/arm/libmla.so (_ZN12medialibrary12MediaLibrary13clearDatabaseEb+148)
2022-01-07 15:06:54.016 16934-16934/? A/DEBUG: #18 pc 016c3049 /data/app/org.videolan.vlc.debug-1/oat/arm/base.odex (offset 0x1590000)
Edited by Duncan McNamara