-
-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xapian crash scenarios #3877
Comments
@mgautierfr Is that a bug in libzim or a handling one in Kiwix Android? |
@mgautierfr There are some other crashes as well reported on the playStore related to Xapian. *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 31615 >>> org.kiwix.kiwixmobile <<<
backtrace:
#00 pc 0x00000000005a92cc /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#01 pc 0x00000000005a9bfc /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#02 pc 0x00000000005aba74 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#03 pc 0x000000000059b2dc /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#04 pc 0x0000000000591b38 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#05 pc 0x00000000005d5a14 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#06 pc 0x000000000057766c /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#07 pc 0x0000000000574f28 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so (Xapian::Query::Internal::postlist_sub_or_like(Xapian::Internal::OrContext&, QueryOptimiser*, double) const+40)
#08 pc 0x000000000057af7c /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#09 pc 0x0000000000574ec4 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so (Xapian::Query::Internal::postlist_sub_and_like(Xapian::Internal::AndContext&, QueryOptimiser*, double) const+40)
#10 pc 0x000000000057a85c /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#11 pc 0x000000000057a774 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#12 pc 0x0000000000574f28 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so (Xapian::Query::Internal::postlist_sub_or_like(Xapian::Internal::OrContext&, QueryOptimiser*, double) const+40)
#13 pc 0x000000000057b1fc /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#14 pc 0x000000000057af7c /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#15 pc 0x00000000005d53c4 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#16 pc 0x00000000005d89a0 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so
#17 pc 0x0000000000567db8 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so (Xapian::Enquire::Internal::get_mset(unsigned int, unsigned int, unsigned int, Xapian::RSet const*, Xapian::MatchDecider const*) const+632)
#18 pc 0x0000000000569c70 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libkiwix.so (Xapian::Enquire::get_mset(unsigned int, unsigned int, unsigned int, Xapian::RSet const*, Xapian::MatchDecider const*) const+36)
#19 pc 0x000000000022c494 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libzim.so (zim::SuggestionSearch::getResults(int, int) const+132)
#20 pc 0x000000000001c573 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/split_config.armeabi_v7a.apk!libzim_wrapper.so (Java_org_kiwix_libzim_SuggestionSearch_getResults+106) (BuildId: 156c0086f806093be1da1b1615c4232400f11639)
#21 pc 0x000000000003c0fb /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/oat/arm/base.odex (art_jni_trampoline+82)
#22 pc 0x0000000002052921 /memfd:/jit-cache (org.kiwix.kiwixmobile.core.search.viewmodel.SearchState.getVisibleResults+480)
#23 pc 0x00000000000d7bc5 /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub_internal+68)
#24 pc 0x000000000042f147 /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+250)
#25 pc 0x00000000000dffb7 /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+174)
#26 pc 0x0000000000210be1 /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+280)
#27 pc 0x000000000020c523 /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+774)
#28 pc 0x00000000004298db /apex/com.android.runtime/lib/libart.so (MterpInvokeVirtualQuick+518)
#29 pc 0x00000000000d6594 /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_virtual_quick+20)
#30 pc 0x0000000000224520 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/oat/arm/base.vdex (org.kiwix.kiwixmobile.core.search.viewmodel.SearchViewModel$$ExternalSyntheticLambda0.subscribe+36)
#31 pc 0x0000000000425b09 /apex/com.android.runtime/lib/libart.so (MterpInvokeInterface+1432)
#32 pc 0x00000000000d2a14 /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_interface+20)
#33 pc 0x00000000001c5a04 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/oat/arm/base.vdex (io.reactivex.internal.operators.flowable.FlowableCreate.subscribeActual+106)
#34 pc 0x0000000000429b33 /apex/com.android.runtime/lib/libart.so (MterpInvokeVirtualQuick+1118)
#35 pc 0x00000000000d6594 /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_virtual_quick+20)
#36 pc 0x00000000001c2b46 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/oat/arm/base.vdex (io.reactivex.Flowable.subscribe+4)
#37 pc 0x0000000000429b33 /apex/com.android.runtime/lib/libart.so (MterpInvokeVirtualQuick+1118)
#38 pc 0x00000000000d6594 /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_virtual_quick+20)
#39 pc 0x00000000001c2ba6 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/oat/arm/base.vdex (io.reactivex.Flowable.subscribe+12)
#40 pc 0x0000000000425b09 /apex/com.android.runtime/lib/libart.so (MterpInvokeInterface+1432)
#41 pc 0x00000000000d2a14 /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_interface+20)
#42 pc 0x00000000001c9da6 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/oat/arm/base.vdex (io.reactivex.internal.operators.flowable.FlowableSubscribeOn$SubscribeOnSubscriber.run+24)
#43 pc 0x0000000000425b09 /apex/com.android.runtime/lib/libart.so (MterpInvokeInterface+1432)
#44 pc 0x00000000000d2a14 /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_interface+20)
#45 pc 0x00000000001cd77a /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/oat/arm/base.vdex (io.reactivex.internal.schedulers.ScheduledRunnable.run+42)
#46 pc 0x0000000000429b33 /apex/com.android.runtime/lib/libart.so (MterpInvokeVirtualQuick+1118)
#47 pc 0x00000000000d6594 /apex/com.android.runtime/lib/libart.so (mterp_op_invoke_virtual_quick+20)
#48 pc 0x00000000001cd690 /data/app/org.kiwix.kiwixmobile-UnW6HgXnf80xedO_Bw0vaw==/oat/arm/base.vdex (io.reactivex.internal.schedulers.ScheduledRunnable.call)
#49 pc 0x00000000001ec45d /apex/com.android.runtime/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.15413681340037344952)+192)
#50 pc 0x00000000001f0c41 /apex/com.android.runtime/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+124)
#51 pc 0x0000000000418cb9 /apex/com.android.runtime/lib/libart.so (artQuickToInterpreterBridge+808)
#52 pc 0x00000000000dc5a1 /apex/com.android.runtime/lib/libart.so (art_quick_to_interpreter_bridge+32)
#53 pc 0x000000000025317d /system/framework/arm/boot.oat (java.util.concurrent.FutureTask.run+196)
#54 pc 0x00000000002de8cf /system/framework/arm/boot.oat (java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run+118)
#55 pc 0x00000000002a8fcf /system/framework/arm/boot.oat (java.util.concurrent.ThreadPoolExecutor.runWorker+1014)
#56 pc 0x00000000002a6c4f /system/framework/arm/boot.oat (java.util.concurrent.ThreadPoolExecutor$Worker.run+54)
#57 pc 0x0000000000183749 /system/framework/arm/boot.oat (java.lang.Thread.run+64)
#58 pc 0x00000000000d7bc5 /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub_internal+68)
#59 pc 0x000000000042f147 /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+250)
#60 pc 0x00000000000dffb7 /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+174)
#61 pc 0x0000000000370c5f /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+54)
#62 pc 0x0000000000371951 /apex/com.android.runtime/lib/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+304)
#63 pc 0x00000000003a28e7 /apex/com.android.runtime/lib/libart.so (art::Thread::CreateCallback(void*)+978)
#64 pc 0x00000000000a75b3 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+20)
#65 pc 0x0000000000061b33 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30) *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 11518 >>> org.kiwix.kiwixmobile <<<
backtrace:
#00 pc 0x0000000000859c78 /vendor/lib64/egl/libGLES_mali.so (vulkan::debug_utils::trigger_address_binding_event(vulkan::device const&, vulkan::object const*, unsigned long, unsigned long, vulkan::debug_utils::binding_type)+24)
#01 pc 0x0000000000868844 /vendor/lib64/egl/libGLES_mali.so (vulkan::image::~image()+52)
#02 pc 0x00000000005c0330 /data/app/~~bB4-q8oRKOQpMyCD-suDdw==/org.kiwix.kiwixmobile-LEfhWv-T0kGNkBWOyRmYpA==/split_config.arm64_v8a.apk!libkiwix.so (Xapian::Database::get_doccount() const+48)
#03 pc 0x00000000005caa34 /data/app/~~bB4-q8oRKOQpMyCD-suDdw==/org.kiwix.kiwixmobile-LEfhWv-T0kGNkBWOyRmYpA==/split_config.arm64_v8a.apk!libkiwix.so (Xapian::Enquire::Internal::get_mset(unsigned int, unsigned int, unsigned int, Xapian::RSet const*, Xapian::MatchDecider const*) const+164)
#04 pc 0x000000000029edd4 /data/app/~~bB4-q8oRKOQpMyCD-suDdw==/org.kiwix.kiwixmobile-LEfhWv-T0kGNkBWOyRmYpA==/split_config.arm64_v8a.apk!libzim.so (zim::SuggestionSearch::getResults(int, int) const+124)
#05 pc 0x0000000000027148 /data/app/~~bB4-q8oRKOQpMyCD-suDdw==/org.kiwix.kiwixmobile-LEfhWv-T0kGNkBWOyRmYpA==/split_config.arm64_v8a.apk!libzim_wrapper.so (Java_org_kiwix_libzim_SuggestionSearch_getResults+168) (BuildId: 6633925cfdce17aa0079498777317a589d32289b)
#06 pc 0x000000000002ce64 /data/app/~~bB4-q8oRKOQpMyCD-suDdw==/org.kiwix.kiwixmobile-LEfhWv-T0kGNkBWOyRmYpA==/oat/arm64/base.odex (art_jni_trampoline+116)
#07 pc 0x00000000005b9a30 /apex/com.android.art/lib64/libart.so (nterp_helper+4016)
#08 pc 0x000000000025f222 /data/app/~~bB4-q8oRKOQpMyCD-suDdw==/org.kiwix.kiwixmobile-LEfhWv-T0kGNkBWOyRmYpA==/base.apk (org.kiwix.kiwixmobile.core.search.viewmodel.SearchState.getVisibleResults+90)
#09 pc 0x00000000005b99d4 /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
#10 pc 0x000000000025d2cc /data/app/~~bB4-q8oRKOQpMyCD-suDdw==/org.kiwix.kiwixmobile-LEfhWv-T0kGNkBWOyRmYpA==/base.apk (org.kiwix.kiwixmobile.core.search.SearchFragment$render$2$1$searchResult$1.invokeSuspend+20)
#11 pc 0x00000000020428c0 /memfd:jit-cache (kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith+176)
#12 pc 0x0000000002027648 /memfd:jit-cache (kotlinx.coroutines.DispatchedTask.run+1208)
#13 pc 0x00000000005ba854 /apex/com.android.art/lib64/libart.so (nterp_helper+7636)
#14 pc 0x000000000020f1a8 /data/app/~~bB4-q8oRKOQpMyCD-suDdw==/org.kiwix.kiwixmobile-LEfhWv-T0kGNkBWOyRmYpA==/base.apk (kotlinx.coroutines.internal.LimitedDispatcher.run+24)
#15 pc 0x00000000005ba7f4 /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
#16 pc 0x0000000000212240 /data/app/~~bB4-q8oRKOQpMyCD-suDdw==/org.kiwix.kiwixmobile-LEfhWv-T0kGNkBWOyRmYpA==/base.apk (kotlinx.coroutines.scheduling.TaskImpl.run+4)
#17 pc 0x00000000005ba7f4 /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
#18 pc 0x00000000002110cc /data/app/~~bB4-q8oRKOQpMyCD-suDdw==/org.kiwix.kiwixmobile-LEfhWv-T0kGNkBWOyRmYpA==/base.apk (kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run+156)
#19 pc 0x000000000033b3a4 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612)
#20 pc 0x000000000023a5d0 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+144)
#21 pc 0x0000000000539bf4 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1600)
#22 pc 0x00000000005395a4 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallbackWithUffdGc(void*)+8)
#23 pc 0x00000000000ca7cc /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204)
#24 pc 0x00000000000607b0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) All the crashes are happening while accessing this method |
I don't know. Exception thrown by Xapian should be catch by libzim and handle there (by fallback to binary search in titles) But the last callstack posted by @MohitMaliFtechiz is strange. Did we have such kind of bug with previous version or it is only |
@mgautierfr We had this type of bug when we were trying to access the results via
For now, it is a crash reported by the playStore. But this issue occurs when we cancel the previous result and ask for the new result set from libzim. As far as I think after seeing the behavior, the callstack is broken due to when we are canceling the previous call and asking for a new result from libzim, at this moment, code has been executed to fetch the result from libzim, and we canceled that operation. But libzim is trying to get the result for that call so that's why it is throwing the error. One more thing here we need to know is that getting the result from libzim is performing on the IO thread to not block the Android UI. Can we catch this type of exception at the libzim level? so that we can prevent this type of errors? |
Are you running different IO thread in the same time ?
Which kind of exception ? Not all crashed are caused by exception. Invalid read (SIGSEGV) or call stack corruption (as because of data race) make the app crash without exception (as any C code which can crash without exception) |
This has been discussed and fixed in the past... but this is the most probable scenario. @MohitMaliFtechiz Can you check again please that you never do two (or more) requests (or request result treatments) at the same time? From what I see (it seems new custom apps are impacted as well), a regression has been built in around the suggestion system in the latest version |
@mgautierfr Yes, we are using the kiwix-android/core/src/main/java/org/kiwix/kiwixmobile/core/search/SearchFragment.kt Lines 297 to 318 in 9f94965
@mgautierfr Okay, so here the crash was happening due to the call stack being corrupted. (in a very special condition since there is a very limited crash shown on the playStore). There was an issue with the mutex call site(we were doing that in the fragment and most of the things were handled by that mutex, but in a very special condition this issue was occurring). I have placed a fix for it in #3885 to avoid accessing the data from libzim with multiple places. Also, added the instrumentation and unit test cases for testing this functionality.
We are currently using the libzim |
Yes, we use anyway the latest version of libzim, but of course exceptions should be caught in Kiwix. |
We still have crashes in Xapian with Kiwix Android
3.11.0
, here two traces:== # 1 ==
== #2 ==
The text was updated successfully, but these errors were encountered: