Skip to content
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

Saving bookmarks in the zim-split splitted ZIM files are crashing the application, when there is a 0 size extra zim chunk. #3861

Closed
MohitMaliFtechiz opened this issue Jun 3, 2024 · 7 comments · Fixed by #3862
Assignees
Milestone

Comments

@MohitMaliFtechiz
Copy link
Collaborator

MohitMaliFtechiz commented Jun 3, 2024

Describe the bug
Saving bookmarks in the zim-split splitted ZIM files are crashing the application, when there is a 0 size extra zim chunk.

Expected behavior
It should not crash.

Steps to reproduce the behavior:

  1. Try to open any splitted ZIM file in the reader.
  2. Click on the bookmark icon at the bottom.
  3. You will see the crash.

Environment

  • Version of Kiwix Android : 3.10.1
  • Device : Google pixel 7a
  • OS version : Android 13

Logs

 Process: org.kiwix.kiwixmobile, PID: 17268
                                                                                                    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:562)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
                                                                                                    Caused by: java.lang.reflect.InvocationTargetException
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878Caused by: java.lang.Exception: Corrupted block detected
                                                                                                    	at org.kiwix.libkiwix.Book.update(Native Method)
                                                                                                    	at org.kiwix.kiwixmobile.core.main.CoreReaderFragment.toggleBookmark(CoreReaderFragment.kt:1758)
                                                                                                    	at org.kiwix.kiwixmobile.core.main.CoreReaderFragment_ViewBinding$6.doClick(CoreReaderFragment_ViewBinding.java:121)
                                                                                                    	at butterknife.internal.DebouncingOnClickListener.onClick(DebouncingOnClickListener.java:26)
                                                                                                    	at android.view.View.performClick(View.java:7729)
                                                                                                    	at android.view.View.performClickInternal(View.java:7706)
                                                                                                    	at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
                                                                                                    	at android.view.View$PerformClick.run(View.java:30484)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:959)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:232)
                                                                                                    	at android.os.Looper.loop(Looper.java:317)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8501)
screen-20240603-143134.mp4
@MohitMaliFtechiz MohitMaliFtechiz added this to the 3.11.0 milestone Jun 3, 2024
@MohitMaliFtechiz MohitMaliFtechiz self-assigned this Jun 3, 2024
@kelson42
Copy link
Collaborator

kelson42 commented Jun 3, 2024

@MohitMaliFtechiz With or without a trailing 0 sized chunk?

@MohitMaliFtechiz MohitMaliFtechiz changed the title Saving bookmarks in the zim-split splitted ZIM files are crashing the application. Saving bookmarks in the zim-split splitted ZIM files are crashing the application, when there is a 0 size extra zim chunk. Jun 3, 2024
@MohitMaliFtechiz
Copy link
Collaborator Author

@MohitMaliFtechiz With or without a trailing 0 sized chunk?

@kelson42 With 0 size extra zim chunk.

@kelson42
Copy link
Collaborator

kelson42 commented Jun 3, 2024

@MohitMaliFtechiz If you remove it, then it works?

@MohitMaliFtechiz
Copy link
Collaborator Author

@kelson42 Yes, if i remove the extra 0 size zim chunk then it starts saving the bookmark.

@kelson42
Copy link
Collaborator

kelson42 commented Jun 3, 2024

Then clear duplicate of #3827

@MohitMaliFtechiz
Copy link
Collaborator Author

@kelson42 However, this is a duplicate of #3827 but we should handle the exception thrown by the libkiwix so that it would not crash our application until #3827 has not been fixed.

@MohitMaliFtechiz
Copy link
Collaborator Author

For the crashing scenario, I have placed a fix in #3862 so that application will not crash if libkiwix throw this type of errors, and updated the #3827 ticket description for this crash scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment