Closed MohitMaliFtechiz closed 9 months ago
This is a Jni/wrapper issue. Libkiwix itself has not problem to return a vector bigger than 512 elements.
Moving to java-libkiwix.
@mgautierfr Thanks for confirming the issue, can you please move this issue to java-libkiwix
and fix it?
@mgautierfr What is the root cause here of the issue? Who can fix it?
Describe the bug
The
Library.getBookmark()
method returns all the bookmarks that we have saved in the library. However, when there is 513 bookmarks in it and we call this method to get the bookmarks it crashes the process on Android 7(API level 24) since this API has the limitation of alocal reference table
of 512. We do not have any method available inLibrary
that can return the requested number of bookmarks fromLibrary
to avoid this type of potential error e.g.Library.getBookmark(count)
.https://github.com/kiwix/libkiwix/blob/9c5f5c7be083dfe5b184f8dae9b8a9183a3d1d20/src/library.cpp#L379
Solutation you suggest
local reference
after their use so it will not reach the maximum value of the table probably like this https://stackoverflow.com/questions/34005559/why-am-i-getting-a-local-reference-table-overflow.count
and returns the bookmarks on base of this count variable.@mgautierfr can you please have a look at this issue?