AndBible / and-bible

AndBible: Bible Study
https://andbible.org
GNU General Public License v3.0
550 stars 193 forks source link

Crash: ArrayIndexOutOfBoundsException / currentDocumentContainsNonScripture #3124

Open tuomas2 opened 6 months ago

tuomas2 commented 6 months ago

https://support.andbible.org/scp/tickets.php?id=2300

nfo:
Version: 5.0.771#5578074e8 fdroid standard release (built 25/11/23 18:54:54)
Android version: 10
Android SDK version: 29
Manufacturer: HMD Global
Model: Nokia C2 Tennen
Storage Mb free: 7512
WebView version: 119.0.6045.194
SQLITE version: 3.42.0
Used heap memory in Mb: 3
Max heap memory in Mb: 128

Exception:
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at org.crosswire.jsword.book.sword.SwordUtil.decodeLittleEndian32(SwordUtil.java:197)
at org.crosswire.jsword.book.sword.TreeKeyIndex.getOffset(TreeKeyIndex.java:118)
at org.crosswire.jsword.book.sword.TreeKeyIndex.getFirstChild(TreeKeyIndex.java:88)
at org.crosswire.jsword.book.sword.GenBookBackend.doReadIndex(GenBookBackend.java:210)
at org.crosswire.jsword.book.sword.GenBookBackend.readIndex(GenBookBackend.java:177)
at org.crosswire.jsword.book.sword.SwordGenBook.activate(SwordGenBook.java:76)
at org.crosswire.common.activate.Activator.activate(Activator.java:51)
at org.crosswire.jsword.book.sword.SwordGenBook.checkActive(SwordGenBook.java:247)
at org.crosswire.jsword.book.sword.SwordGenBook.getKey(SwordGenBook.java:200)
at net.bible.service.history.HistoryManager.restoreFrom(HistoryManager.kt:103)
at net.bible.android.control.page.window.WindowRepository.loadFromDb(WindowRepository.kt:359)
at net.bible.android.control.page.window.WindowRepository.initialize(WindowRepository.kt:104)
at net.bible.android.control.page.window.WindowRepository.getActiveWindow(WindowRepository.kt:117)
at net.bible.android.control.page.window.WindowControl.getActiveWindow(WindowControl.kt:75)
at net.bible.android.control.page.window.WindowControl.getActiveWindowPageManager(WindowControl.kt:70)
at net.bible.android.control.search.SearchControl.getCurrentPassageDocument(SearchControl.kt:196)
at net.bible.android.control.search.SearchControl.currentDocumentContainsNonScripture(SearchControl.kt:199)
at net.bible.android.view.activity.search.searchresultsactionbar.ScriptureToggleActionBarButton.getCanShow(ScriptureToggleActionBarButton.kt:39)
at net.bible.android.view.activity.base.actionbar.QuickActionButton.update(QuickActionButton.kt:60)
at net.bible.android.view.activity.base.actionbar.QuickActionButton.addToMenu(QuickActionButton.kt:48)
at net.bible.android.view.activity.search.searchresultsactionbar.SearchResultsActionBarManager.prepareOptionsMenu(SearchResultsActionBarManager.kt:48)
at net.bible.android.view.activity.base.CustomTitlebarActivityBase.onPrepareOptionsMenu(CustomTitlebarActivityBase.kt:58)
at android.app.Activity.onPreparePanel(Activity.java:4092)
at androidx.activity.ComponentActivity.onPreparePanel(ComponentActivity.java:511)
at androidx.fragment.app.FragmentActivity.onPrepareOptionsPanel(FragmentActivity.java:485)
at androidx.fragment.app.FragmentActivity.onPreparePanel(FragmentActivity.java:470)
at androidx.appcompat.view.WindowCallbackWrapper.onPreparePanel(WindowCallbackWrapper.java:100)
at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.onPreparePanel(AppCompatDelegateImpl.java:3477)
at androidx.appcompat.app.AppCompatDelegateImpl.preparePanel(AppCompatDelegateImpl.java:2054)
at androidx.appcompat.app.AppCompatDelegateImpl.doInvalidatePanelMenu(AppCompatDelegateImpl.java:2313)
at androidx.appcompat.app.AppCompatDelegateImpl$2.run(AppCompatDelegateImpl.java:281)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7386)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:499)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
tuomas2 commented 6 months ago

User has come to search results view when app has been closed and been uninitialized. Reading document has failed, which is probably due to multi-thread read issue (JSword can't handle well).