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

Version 3.8.1 crashes when opening zim files #3600

Closed
Popolechien opened this issue Dec 15, 2023 · 60 comments
Closed

Version 3.8.1 crashes when opening zim files #3600

Popolechien opened this issue Dec 15, 2023 · 60 comments
Assignees
Labels
Milestone

Comments

@Popolechien
Copy link
Member

We got multiple reports from users that trying to open a zim file would crash their app. Here is one that could provide a bit more info:

Motorola G6-play smartphone with Android 9 (ok in that case that could be an android thing, but I recall seeing reports with more recent versions; I'll try and confirm).

Here is the debugging output of Kiwix:

"          Current Zim File:
        null
        All Zim Files in DB:
        Vikilibroj:
Articles: [879]
Creator: [Wikibooks], PhET Interactive Simulations:
Articles: [97]
Creator: [University of Colorado], Wikipedia:
Articles: [2854052]
Creator: [Wikipedia], Wikipedia:
Articles: [2854080]
Creator: [Wikipedia], Wikivoyage:
Articles: [20162]
Creator: [Wikivoyage]
       
  Current Locale:
de_DE

  BluetoothClass.Device Details:
Device:[aljeter]
Model:[moto g(6) play]
Manufacturer:[motorola]
Time:[1586020549000]
Android Version:[9]
App Version:[3.8.1 7230801]

      Mount Points
    MountInfo(device=rootfs, mountPoint=/, fileSystem=rootfs)
, MountInfo(device=tmpfs, mountPoint=/dev, fileSystem=tmpfs)
, MountInfo(device=devpts, mountPoint=/dev/pts, fileSystem=devpts)
, MountInfo(device=none, mountPoint=/dev/cpuctl, fileSystem=cgroup)
, MountInfo(device=adb, mountPoint=/dev/usb-ffs/adb, fileSystem=functionfs)
, MountInfo(device=proc, mountPoint=/proc, fileSystem=proc)
, MountInfo(device=sysfs, mountPoint=/sys, fileSystem=sysfs)
, MountInfo(device=selinuxfs, mountPoint=/sys/fs/selinux, fileSystem=selinuxfs)
, MountInfo(device=debugfs, mountPoint=/sys/kernel/debug, fileSystem=debugfs)
, MountInfo(device=tracefs, mountPoint=/sys/kernel/debug/tracing, fileSystem=tracefs)
, MountInfo(device=pstore, mountPoint=/sys/fs/pstore, fileSystem=pstore)
, MountInfo(device=tmpfs, mountPoint=/mnt, fileSystem=tmpfs)
, MountInfo(device=/dev/block/bootdevice/by-name/persist, mountPoint=/mnt/vendor/persist, fileSystem=ext4)
, MountInfo(device=/dev/block/dm-3, mountPoint=/mnt/expand/f7e4a008-98b5-4ebd-9e05-1244fffba445, fileSystem=f2fs)
, MountInfo(device=/mnt/expand/f7e4a008-98b5-4ebd-9e05-1244fffba445/media, mountPoint=/mnt/runtime/default/emulated, fileSystem=sdcardfs)
, MountInfo(device=/mnt/expand/f7e4a008-98b5-4ebd-9e05-1244fffba445/media, mountPoint=/mnt/runtime/read/emulated, fileSystem=sdcardfs)
, MountInfo(device=/mnt/expand/f7e4a008-98b5-4ebd-9e05-1244fffba445/media, mountPoint=/mnt/runtime/write/emulated, fileSystem=sdcardfs)
, MountInfo(device=/dev/block/dm-0, mountPoint=/system, fileSystem=ext4)
, MountInfo(device=/dev/block/dm-1, mountPoint=/vendor, fileSystem=ext4)
, MountInfo(device=/dev/block/bootdevice/by-name/modem, mountPoint=/vendor/firmware_mnt, fileSystem=ext4)
, MountInfo(device=/dev/block/bootdevice/by-name/dsp, mountPoint=/vendor/dsp, fileSystem=ext4)
, MountInfo(device=/dev/block/bootdevice/by-name/fsg, mountPoint=/vendor/fsg, fileSystem=ext4)
, MountInfo(device=none, mountPoint=/acct, fileSystem=cgroup)
, MountInfo(device=none, mountPoint=/config, fileSystem=configfs)
, MountInfo(device=/dev/block/bootdevice/by-name/cache, mountPoint=/cache, fileSystem=ext4)
, MountInfo(device=/dev/block/bootdevice/by-name/persist, mountPoint=/persist, fileSystem=ext4)
, MountInfo(device=/dev/block/bootdevice/by-name/oem, mountPoint=/oem, fileSystem=ext4)
, MountInfo(device=/dev/block/dm-2, mountPoint=/data, fileSystem=f2fs)
, MountInfo(device=tmpfs, mountPoint=/storage, fileSystem=tmpfs)
, MountInfo(device=/mnt/expand/f7e4a008-98b5-4ebd-9e05-1244fffba445/media, mountPoint=/storage/emulated, fileSystem=sdcardfs)
, MountInfo(device=tmpfs, mountPoint=/storage/self, fileSystem=tmpfs)

    External Directories
    /storage/emulated/0/Android/data/org.kiwix.kiwixmobile/files "
@stefan-inf
Copy link

[I'm the guy with the Moto G6-play with Android 9]
I downgraded to Kiwix 3.7.1. Crashes immediately after starting...
I suppose that an update of Android System WebView (or Carrier Services) caused the problems with all versions of Kiwix.

Is there a dependency of Kiwix to WebView (or Carrier Services)? Is it possible to say which version of WebView (and Carrier Services) would be ok for Kiwix 3.7.1?

@kelson42 kelson42 self-assigned this Dec 16, 2023
@kelson42 kelson42 added this to the 3.9.0 milestone Dec 16, 2023
@kelson42
Copy link
Collaborator

@stefan-inf Thank you for your bug report. Does it work better with the nightly or with the version 3.9.0 (to be released later today)?

@stefan-inf
Copy link

Nightly and 3.9.0 crash as well, directly when started, as does the 3.8.1, all with the actual WeView and Carrier Services.

@kelson42 kelson42 removed the question label Dec 16, 2023
@kelson42 kelson42 modified the milestones: 3.9.0, 3.10.0, 3.9.1 Dec 16, 2023
@kelson42
Copy link
Collaborator

@stefan-inf Thank you for your quick feedback, we will investigate in priority your bug.

@MohitMaliFtechiz
Copy link
Collaborator

@stefan-inf Thanks for providing the information. Can you please provide some additional information?

I downgraded to Kiwix 3.7.1. Crashes immediately after starting...

Is it only crashing when you are trying to open the ZIM file?

Is there a dependency of Kiwix to WebView (or Carrier Services)?

Yes, kiwix uses the webview to load the content.

Is it possible to say which version of WebView (and Carrier Services) would be ok for Kiwix 3.7.1?

Which version exactly you are using right now?

Can you please upgrade it to the latest one? The current stable version of Android System WebView is 120.0.6099.43.

@stefan-inf
Copy link

Now, every version is crashing immediately after starting. Before, the 3.8.2 crashed only when opening a ZIM file, now when started. I have the 3.9.0 with WebView 120.0.6099.43.

@stefan-inf
Copy link

Sorry, pls read 3.8.1 instead of 3.8.2.

@MohitMaliFtechiz
Copy link
Collaborator

@stefan-inf Thanks for testing. We need the crash logs to debug the problem since I am not able to reproduce it on my device.

Can you please install this APK https://drive.google.com/file/d/11JYfBfYf3H4dIUibZ0tuMlT_vtOEm0xn/view?usp=sharing, it will prompt for reporting the issue with logs after the crash, let all checkboxes enable for crash details, click on the SEND DETAILS button, and send it on futuretechnoworld.mohit@gmail.com via gmail. It would be very helpful for debugging the actual problem.

Screenshot from 2023-12-20 17-24-25

@stefan-inf
Copy link

I installed the APK and started it, but it crashed before prompting to report. However, it took longer (3sec) before it crashed...

@MohitMaliFtechiz
Copy link
Collaborator

@stefan-inf If this is the case it is the WebView issue, not the code-related issue, it seems your device's webView using the same data directory for more than one process at once which is not supported.

Can you please try with this APK https://drive.google.com/file/d/1YqzNlVamldSZQmVEsDvCoHmiusq0tu9G/view?usp=sharing.

@stefan-inf
Copy link

I installed and started this APK, but no changes... Is there another way to solve the WebView problem? Maybe by including WeView in the Kiwix executable?

@MohitMaliFtechiz
Copy link
Collaborator

@stefan-inf I set the data directory with Kiwix's current process in my last APK, However, your problem seems different with webview without the logs it's hard to tell what is going on with your device. We can use the Firebase Crash but it also requires the app to run without crash at least for 5-10 seconds, for sending the crash report https://firebase.google.com/docs/crashlytics/test-implementation?platform=android&hl=en&authuser=0&_gl=1*1jez4ry*_ga*MTEyMDIzNTM3MS4xNzAzMTQxMTY1*_ga_CW55HF8NVT*MTcwMzE0MTE2NS4xLjEuMTcwMzE0NDg2MC41Ni4wLjA , in our case your app does not run so firebase will not work here.

If you have time, I can run the application on your machine and see what's going on in your device, this is the only way I see now.

@stefan-inf
Copy link

How does this work that you run the app on my machne?

@MohitMaliFtechiz
Copy link
Collaborator

How does this work that you run the app on my machine?

You just need to install Android Studio on your machine, and I will connect to your system and run the application on the device via Android Studio. this way I can see what is going on your device.

@stefan-inf
Copy link

How to install Android Studio? It's neither in PlayStore nor in Aptoide...

@kelson42 kelson42 modified the milestones: 3.9.1, 3.10.0 Dec 25, 2023
@stefan-inf
Copy link

BTW, the app "Wikipedia Medizin (offline)" (Playstore, V2023-07) does not crash and works fine...

@MohitMaliFtechiz
Copy link
Collaborator

@stefan-inf Thanks for your feedback. If none of these methods resolve the issue. Then we need to wait for #3141 to be implemented since the issue is related to the Fetch library which is not in our hands, we are planning to replace the Fetch library in #3141.

@kelson42 kelson42 modified the milestones: 3.11.0, 3.10.0 Apr 17, 2024
@kelson42
Copy link
Collaborator

Moving back to milestone 3.10.0 because I strongly suspect we are impacted here by openzim/libzim#866.

@MohitMaliFtechiz We should release and then test with a new release of libkiwix-java integrating libzim 9.2.0

@kelson42
Copy link
Collaborator

@stefan-inf I would recommend to test latest nightly which integrates latest libzim 9.2.0. Fetch problems will be fixed in version 3.11.0 which is next milestone of Kiwix Android we have to work on.

@kelson42 kelson42 modified the milestones: 3.10.0, 3.11.0 Apr 23, 2024
@stefan-inf
Copy link

Thank you for the new version 3.10. Result: Kiwix crashes immediately after starting (before the GUI appears).

@kelson42
Copy link
Collaborator

@stefan-inf Thank you for taking - again - the time to test with cutting edge version.
@MohitMaliFtechiz Once 3.10.0 released, please put focus again on this, such crash at start scenarios have to be fixed in priority.

@stefan-inf
Copy link

Crash behaviour: I have to add that after starting Kiwix, the black logo appears on white ground and stays for 4 seconds before it crashes...

@kelson42
Copy link
Collaborator

kelson42 commented Jun 7, 2024

@MohitMaliFtechiz Fixed by #3867?

@stefan-inf
Copy link

Hi, is there a new Kiwix version (with the new lib) which I could test?

@MohitMaliFtechiz
Copy link
Collaborator

@stefan-inf
Copy link

The new version (3.11.0) crashes immediately after starting, ie before selecting the ZIM file. Seems to be the other issue.

@kelson42
Copy link
Collaborator

kelson42 commented Jun 7, 2024

@MohitMaliFtechiz Understanding what still goes wrong is the priority, we should really try to fix this in 3.11.0 . If the issue is related to Fetch please share the rationals.

@kelson42 kelson42 modified the milestones: 3.11.0, 3.12.0, 3.11.1 Jun 7, 2024
@kelson42
Copy link
Collaborator

@MohitMaliFtechiz This bug report is living for to old. Can we have a clear crashlog so we at least know where it dies?

@Popolechien
Copy link
Member Author

Here is another report that was sent this morning, if it helps (lmk if we need to ask for more details):
logs1718251292832.txt

@MohitMaliFtechiz
Copy link
Collaborator

@Popolechien Thanks for the report. I am assuming this crash report is of @stefan-inf (please correct if i am wrong). I checked this crash report and found that it is a ServiceWorkerInitialiser crash. I am placing a fix for it and will provide an apk to test.

06-12 22:49:30.853 22073 22073 E AndroidRuntime: Process: org.kiwix.kiwixmobile, PID: 22073
06-12 22:49:30.853 22073 22073 E AndroidRuntime: java.lang.ExceptionInInitializerError
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at org.kiwix.kiwixmobile.core.di.components.DaggerCoreComponent$CoreComponentImpl.inject(DaggerCoreComponent.java:23)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at org.kiwix.kiwixmobile.core.CoreApp.onCreate(CoreApp.kt:104)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1266)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7619)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2400)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:226)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:313)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:8762)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: Caused by: java.lang.RuntimeException: Using WebView from more than one process at once with the same data directory is not supported. https://crbug.com/558377 : Current process org.kiwix.kiwixmobile (pid 22073), lock owner org.kiwix.kiwixmobile:error_activity (pid 21360)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at org.chromium.android_webview.AwDataDirLock.b(chromium-TrichromeWebViewGoogle6432.aab-stable-642216533:201)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at org.chromium.android_webview.AwBrowserProcess.j(chromium-TrichromeWebViewGoogle6432.aab-stable-642216533:16)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at com.android.webview.chromium.L.d(chromium-TrichromeWebViewGoogle6432.aab-stable-642216533:203)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at com.android.webview.chromium.L.b(chromium-TrichromeWebViewGoogle6432.aab-stable-642216533:42)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at com.android.webview.chromium.WebViewChromiumFactoryProvider.getServiceWorkerController(chromium-TrichromeWebViewGoogle6432.aab-stable-642216533:22)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at android.webkit.ServiceWorkerController.getInstance(ServiceWorkerController.java:57)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at androidx.webkit.internal.ApiHelperForN.getServiceWorkerControllerInstance(ApiHelperForN.java:1)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at androidx.webkit.internal.ServiceWorkerControllerImpl.<init>(ServiceWorkerControllerImpl.java:9)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	at androidx.webkit.ServiceWorkerControllerCompat$LAZY_HOLDER.<clinit>(ServiceWorkerControllerCompat.java:3)
06-12 22:49:30.853 22073 22073 E AndroidRuntime: 	... 13 more

@stefan-inf We have fixed the arm architeture related isssue and the bug report is very old now can you please provide the latest report so that we can know about where is the problem exist now.

@Popolechien
Copy link
Member Author

@MohitMaliFtechiz No it's another user.

@MohitMaliFtechiz
Copy link
Collaborator

@MohitMaliFtechiz No it's another user.

@Popolechien Okay.

@stefan-inf The bug report is very old now can you please provide the latest report so that we can know where the problem exists now?

@kelson42
Copy link
Collaborator

kelson42 commented Jun 19, 2024

No feedback unfortunately. Closing

@stefan-inf
Copy link

Kiwix now works again. Thank you.

@MohitMaliFtechiz
Copy link
Collaborator

@stefan-inf Thanks for your feedback, happy to know that the problem is fixed for you 😇.

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

Successfully merging a pull request may close this issue.

4 participants