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

Fulltext crash with custom app wikimed #201

Closed
kelson42 opened this issue Jul 17, 2017 · 11 comments
Closed

Fulltext crash with custom app wikimed #201

kelson42 opened this issue Jul 17, 2017 · 11 comments
Assignees
Labels

Comments

@kelson42
Copy link
Collaborator

kelson42 commented Jul 17, 2017

Currently in alpha. The crash happens just after the first character is put in the search box.

@kelson42 kelson42 added the bug label Jul 17, 2017
@mhutti1
Copy link
Contributor

mhutti1 commented Jul 17, 2017

07-17 19:17:41.627 28918-28916/? A/google-breakpad: Microdump skipped (uninteresting)
07-17 19:17:41.650 27579-28916/? W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
07-17 19:17:41.650 27579-28916/? W/google-breakpad: Chrome build fingerprint:
07-17 19:17:41.650 27579-28916/? W/google-breakpad: 1171980
07-17 19:17:41.650 27579-28916/? W/google-breakpad: 1171980
07-17 19:17:41.650 27579-28916/? W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
07-17 19:17:41.653 27579-28916/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 28916 (Filter)
[ 07-17 19:17:41.658   375:  375 W/         ]
debuggerd: handling request: pid=27579 uid=10382 gid=10382 tid=28916
07-17 19:17:41.722 892-8305/? I/ActivityManager: Start proc 28920:com.android.chrome:privileged_process0/u0a41 for service com.android.chrome/org.chromium.content.app.PrivilegedProcessService0
07-17 19:17:41.760 28919-28919/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-17 19:17:41.760 28919-28919/? A/DEBUG: Build fingerprint: 'google/bullhead/bullhead:7.1.2/N2G47Z/4045513:user/release-keys'
07-17 19:17:41.760 28919-28919/? A/DEBUG: Revision: 'rev_1.0'
07-17 19:17:41.760 28919-28919/? A/DEBUG: ABI: 'arm64'
07-17 19:17:41.760 28919-28919/? A/DEBUG: pid: 27579, tid: 28916, name: Filter  >>> org.kiwix.kiwixcustomwikimed <<<
07-17 19:17:41.760 28919-28919/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
07-17 19:17:41.760 28919-28919/? A/DEBUG:     x0   0000000000000000  x1   0000000000000022  x2   0000000000000001  x3   000000763098a298
07-17 19:17:41.760 28919-28919/? A/DEBUG:     x4   0000000000000001  x5   000000000000fffd  x6   0000000000000000  x7   000000763098a298
07-17 19:17:41.760 28919-28919/? A/DEBUG:     x8   ffffffffffffffff  x9   fefefefeff76ff69  x10  7f7f7f7f7f7f7f7f  x11  0101010101010101
07-17 19:17:41.760 28919-28919/? A/DEBUG:     x12  0000000000000008  x13  ffffffffffffffff  x14  ffffff0000000000  x15  ffffffffffffffff
07-17 19:17:41.760 28919-28919/? A/DEBUG:     x16  0000007639cebf98  x17  0000007654b64368  x18  0000007653aad4b0  x19  000000763098a3f0
07-17 19:17:41.760 28919-28919/? A/DEBUG:     x20  0000007653aa8cb0  x21  00000076358e3200  x22  000000763098a75c  x23  000000763a167c18
07-17 19:17:41.760 28919-28919/? A/DEBUG:     x24  0000000000000008  x25  4e1dfa3cff2cd1a4  x26  00000076358e3298  x27  4e1dfa3cff2cd1a4
07-17 19:17:41.760 28919-28919/? A/DEBUG:     x28  0000000000000002  x29  000000763098a2f0  x30  000000763964957c
07-17 19:17:41.760 28919-28919/? A/DEBUG:     sp   000000763098a2f0  pc   0000007639649580  pstate 0000000060000000
07-17 19:17:41.779 28919-28919/? A/DEBUG: backtrace:
07-17 19:17:41.780 28919-28919/? A/DEBUG:     #00 pc 0000000000232580  /data/app/org.kiwix.kiwixcustomwikimed-1/lib/arm64/libkiwix.so (_ZN5kiwix13removeAccentsERKSs+112)
07-17 19:17:41.780 28919-28919/? A/DEBUG:     #01 pc 000000000022eb94  /data/app/org.kiwix.kiwixcustomwikimed-1/lib/arm64/libkiwix.so (_ZN5kiwix8Searcher6searchERSsjjb+316)
07-17 19:17:41.780 28919-28919/? A/DEBUG:     #02 pc 00000000002407d8  /data/app/org.kiwix.kiwixcustomwikimed-1/lib/arm64/libkiwix.so (Java_org_kiwix_kiwixlib_JNIKiwix_indexedQuery+132)
07-17 19:17:41.780 28919-28919/? A/DEBUG:     #03 pc 0000000000877db0  /data/app/org.kiwix.kiwixcustomwikimed-1/oat/arm64/base.odex (offset 0x7d2000)

@kelson42
Copy link
Collaborator Author

Same crash with Kiwix for Android. The ZIM file is OK, I have tested with kiwix-serve.

@kelson42
Copy link
Collaborator Author

@mhutti1 Do you know which JNI call is made and can you check the arguments look OK?
@mgautierfr An idea?

@mhutti1
Copy link
Contributor

mhutti1 commented Jul 17, 2017

Java_org_kiwix_kiwixlib_JNIKiwix_indexedQuery+132

@mgautierfr
Copy link
Member

The SIGSERV seems to appear in the kiwix::removeAccents function.

Same crash with Kiwix for Android.

Which version of kiwix-lib is used in android application ? Is it the nightly ? (The older the version is, the better it is)

@mgautierfr
Copy link
Member

mgautierfr commented Jul 18, 2017

~~In the search entry, I enter a letter, suggestions appear, I can click on a suggestion or enter other letters.~~
~~So everything seems to work fine.~~

My bad, I hadn't activate fulltext search.

Which exact version (version_code) have you ? 
You can find it the "Applications" entry in android (global) settings.
When selecting "Medical Wikipedia" to get the info, under the title there is a number (me is `171980`).
This is the version_code of the apk you've installed.

@mgautierfr
Copy link
Member

I suppose that it is related to the change we've made about icu data file at commit 6fa885f and 57744b3

Those commits removed the version information of the data filename because we wanted kiwix-android not dependent of the icu version.

But from icu documentation (http://userguide.icu-project.org/icudata) it seems that the name of the data file must include the icu version and a format flag.
As the mentioned commits were removing those information from the filename, I suppose that icu cannot find the data file (even if we set the datadirectory)

I will change a bit the loadICUData function https://github.com/kiwix/kiwix-android/blob/master/app/src/main/java/org/kiwix/kiwixmobile/ZimContentProvider.java#L267 and kiwix-build and test further if it fixes the bug.

@kelson42
Copy link
Collaborator Author

@mgautierfr Thx!

mgautierfr added a commit that referenced this issue Jul 18, 2017
Instead of directly copying "icudt.dat" file, copy all file in "icu"
assets directory.

The icu data filename must include the version of icu lib.
But we don't want android code to be dependent of the icu lib version.
So let's copy all files in the icu directory.

Fixes #201.
@mgautierfr
Copy link
Member

I confirm my assumption, it is a problem with icu data filename.
PR #206 fix the problem.

I'm rebuilding a new alpha version. It will be uploaded in the hour.

@mgautierfr
Copy link
Member

New alpha version of wikimed uploaded. Next update from play store should fix this issue.
(Close the issue if you can confirm on your side)

@kelson42
Copy link
Collaborator Author

Works fine now :)

mhutti1 pushed a commit that referenced this issue Jul 18, 2017
Instead of directly copying "icudt.dat" file, copy all file in "icu"
assets directory.

The icu data filename must include the version of icu lib.
But we don't want android code to be dependent of the icu lib version.
So let's copy all files in the icu directory.

Fixes #201.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants