-
-
Notifications
You must be signed in to change notification settings - Fork 448
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
Zim-tools
version 3.3.0
splitted zim files giving Corrupted block detected
error when there is a 0 size extra ZIM chunk.
#3827
Comments
This use case is really strange.
So I feel like either:
Can you run |
@mgautierfr The sha256sum is the same on both android and Linux. Linux sha256sum sha256sum wikipedia_ar_all_nopic_2024-03.zim*
f744022ed8208a50a1ce191cd5af946debc4012d36c41f7c338e8ae904b86303 wikipedia_ar_all_nopic_2024-03.zim
8fd91f8f328ca1a5c77129fd7e4d7435f663fa632e9c0078c3d38d0bccdea366 wikipedia_ar_all_nopic_2024-03.zimaa
eb1892b3bfee9876626a12bff57d90c6663ab143e74d88e8ebddc6084f167e82 wikipedia_ar_all_nopic_2024-03.zimab
33729314abe6b640d918770cfd9146a13b49eac537a52b00e6568e3a358d1ce5 wikipedia_ar_all_nopic_2024-03.zimac
b17e5f6fbbc140486cab4c19adc8970364796acdbd06a8a9439e501d02cfb040 wikipedia_ar_all_nopic_2024-03.zimad
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 wikipedia_ar_all_nopic_2024-03.zimae On Android sha256sum wikipedia_ar_all_nopic_2024-03.zim*
8fd91f8f328ca1a5c77129fd7e4d7435f663fa632e9c0078c3d38d0bccdea366 wikipedia_ar_all_nopic_2024-03.zimaa
eb1892b3bfee9876626a12bff57d90c6663ab143e74d88e8ebddc6084f167e82 wikipedia_ar_all_nopic_2024-03.zimab
33729314abe6b640d918770cfd9146a13b49eac537a52b00e6568e3a358d1ce5 wikipedia_ar_all_nopic_2024-03.zimac
b17e5f6fbbc140486cab4c19adc8970364796acdbd06a8a9439e501d02cfb040 wikipedia_ar_all_nopic_2024-03.zimad
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 wikipedia_ar_all_nopic_2024-03.zimae
Might be possible, if the extra empty part is created by other systems (e.g. here kiwix-tools), and extra part is working in test case because it is created by the android itself. But we need to ensure that, this is the case here. |
@MohitMaliFtechiz As far as I know title is wrong, it is having problem only if you have a 0 sized surnumerous ZIM chunk (which is not always the case)? You confirm? |
@kelson42 You are right. The problem only happens when there is a 0 size extra zim file. |
Zim-tools
version 3.3.0
splitted zim files giving Corrupted block detected
error.Zim-tools
version 3.3.0
splitted zim files giving Corrupted block detected
error when there is a 0 size extra ZIM chunk.
@mgautierfr Here is the debug stack trace of the application, when this error happens. |
@mgautierfr Any news on this? |
@mgautierfr With the new FATAL EXCEPTION: DefaultDispatcher-worker-19
Process: org.kiwix.kiwixmobile, PID: 11803
java.lang.Exception: Cannot read chars.
- File part is /storage/37B9-D7D4/Documents/wikipedia_ar_all_nopic_2024-03.zimad
- File part size is 3187373325
- File part range is 6075257308-9262630633
- size_to_get is 1024
- total size is 1024
- Reading offset at 6075257161
- logical local offset is 18446744073709551469
- physical local offset is 18446744073709551469
- error is Cannot read file
: Invalid argument
at org.kiwix.libzim.Item.getData(Native Method)
at org.kiwix.kiwixmobile.core.reader.ZimFileReader$streamZimContentToPipe$1.invokeSuspend(ZimFileReader.kt:364)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) |
@MohitMaliFtechiz Thanks for the trace. I may have found something. |
@mgautierfr Thanks for providing the binaries, I can confirm that this issue is fixed by this solution. |
This issue is not fully fixed since we have not integrated the latest binaries in the application. We should keep this ticket until the new java-libkiwix is not integrated into the project with openzim/libzim#903 this fix. |
@MohitMaliFtechiz The issue is fixed from libzim perspective, if you want to keep track at Android level, I recomment to open an issue there. Otherwise, I agree we should release libzim soon and use it in next Kiwix Android release. |
@MohitMaliFtechiz Sorry, did not realised it was in kiwix-android. |
Describe the bug
Corrupted block detected
error when getting thegetArticleCount()
andgetMediaCount()
with zim-tools's splitted zim files(When there is a 0size size extra part) However, we can read the zim file content. If we delete that 0 size extra part from our storage then there is no error and it starts giving the value from these methods.getArticleCount()
andgetMediaCount()
. Also, if we split any zim file with this test case and tries to load it in our application then these methods retuns the value.update(Archive archive)
method of theBook
class.Expected behavior
It should return the value from the
getArticleCount()
andgetMediaCount()
methods withzim-tools
splitted zim file as well.The text was updated successfully, but these errors were encountered: