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

Crash on Get Content when a particular zim is anywhere on internal storage #896

Closed
metal450 opened this issue Nov 13, 2018 · 33 comments
Closed
Labels
Milestone

Comments

@metal450
Copy link

metal450 commented Nov 13, 2018

Describe the bug
I have a zim created from a Fandom wiki (http://prepaid-data-sim-card.wikia.com/wiki/Prepaid_SIM_with_data) by zimmer (https://github.com/vss-devel/zimmer). The zim works perfectly in Kiwix for Windows. If I copy the zim to the phone's internal storage, launch Kiwix, & go to "Get Content," it immediately crashes. The zim needn't even be in Kiwix's data folder to cause the crash, just sticking it at the root of the storage also causes the issue. As soon as I delete the zim, the "Get Content" screen will again work properly.

Steps to reproduce the behavior:

  1. Build a ZIM:
    git clone https://github.com/vss-devel/zimmer
    cd zimmer
    npm install
    node wikizimmer http://prepaid-data-sim-card.wikia.com/wiki/Alaska
    node zimmer --optimg prepaid-data-sim-card.wikia.com
  2. Test the ZIM in Kiwix 0.9 for Windows. Works great.
  3. Copy the ZIM to your phone
  4. Go to Get Content
  5. Crash

Environment

  • Version of Kiwix Android : 2.4 build 1182160
  • Device : Galaxy S9
  • OS version : 8.0
@Aditya-Sood
Copy link
Contributor

Aditya-Sood commented Nov 15, 2018

Hi @metal450

  1. Does it happen for any of the ZIMs downloaded on Kiwix, when you move them to a different location?
  2. Have you experienced this issue with ZIM files from other sources/zim-creators before?
  3. Also can you post the stack trace of the crash?

@metal450
Copy link
Author

  1. Nope
  2. Nope, but I haven't tried any others. I have 3 ZIMs (2 of which are from Kiwix directly, & this one)
  3. How do I obtain one?

@Aditya-Sood
Copy link
Contributor

For the stack trace you can use adb logcat:

  • Plug in your device, run the command on the terminal and then reproduce the error.

  • As soon as the app crashes, you'll get an error on the terminal screen like .../org.kiwix.kiwixmobile E/AndroidRuntime: FATAL EXCEPTION: main Process: org.kiwix.kiwixmobile... followed by a bunch of lines specifying the stack trace of the error in multiple files. Copy and paste that whole section.

For point (2), try creating another one or two ZIMs if possible and check whether they reproduce the error. If the error is in creation of the ZIM file, then we'll have to focus outside the app.

@metal450
Copy link
Author

metal450 commented Nov 15, 2018

try creating another one or two ZIMs if possible and check whether they reproduce the error

I tried 1 more, & the behavior was the same. Works fine on PC, crashes on Android. Were you not able to reproduce this by replicating my specific steps above?

Stack Trace

While I don't see the exact text you're mentioning, here's the section around the term "Fatal":

11-15 11:39:34.262 19385 19531 I kiwix   : Opening ZIM file /storage/emulated/0/Android/Kiwix/wikivoyage_en_all_novid_2018-10.zim
11-15 11:39:34.262 19385 19531 I kiwix   : Attempting to create reader with: /storage/emulated/0/Android/Kiwix/wikivoyage_en_all_novid_2018-10.zim
11-15 11:39:34.263 19385 19531 I kiwix   : Opening ZIM file /storage/emulated/0/Android/Kiwix/wikivoyage_en_all_novid_2018-10.zim
11-15 11:39:34.268 19385 19534 D OkHttp  : --> GET http://download.kiwix.org/library/library_zim.xml http/1.1
11-15 11:39:34.272 19385 19472 I OpenGLRenderer: destroy mLayerUpdateQueue is not empty, size = 1
11-15 11:39:34.272 19385 19472 I OpenGLRenderer: name = PopupWindow$PopupBackgroundView, size (588, 1296)
11-15 11:39:34.339 19385 19531 I kiwix   : Attempting to create reader with: /storage/emulated/0/Android/Kiwix/wikivoyage_en_all_novid_2018-10.zim
11-15 11:39:34.340 19385 19531 I kiwix   : Opening ZIM file /storage/emulated/0/Android/Kiwix/wikivoyage_en_all_novid_2018-10.zim
11-15 11:39:34.341 19385 19531 I kiwix   : Attempting to create reader with: /storage/emulated/0/prepaid-data-sim-card.wikia.com.zim
11-15 11:39:34.344 19385 19531 I kiwix   : Opening ZIM file /storage/emulated/0/prepaid-data-sim-card.wikia.com.zim
11-15 11:39:34.377 19385 19472 I OpenGLRenderer: Frame state surface 0x745a0db3b0, 0x0, EGL=EGL_NOT_INITIALIZED
11-15 11:39:34.377 19385 19472 I OpenGLRenderer: EGLSwapBuffers state surface 0x0
11-15 11:39:34.377 19385 19472 E libEGL  : Could not restore original EGL context
11-15 11:39:34.377 19385 19472 E libEGL  : eglMakeCurrent:1108 error 3001 (EGL_NOT_INITIALIZED)
11-15 11:39:34.378 19385 19472 F OpenGLRenderer: Failed to make current on surface 0x747dc14760, error=EGL_NOT_INITIALIZED
11-15 11:39:34.414  6934  6934 D KeyguardUpdateMonitor: handleStatusBarState( false )
11-15 11:39:34.426 19541 19472 F google-breakpad: Microdump skipped (uninteresting)
11-15 11:39:34.435 19385 19472 W google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
11-15 11:39:34.435 19385 19472 W google-breakpad: Chrome build fingerprint:
11-15 11:39:34.435 19385 19472 W google-breakpad: 67.0.3396.87
11-15 11:39:34.435 19385 19472 W google-breakpad: 339608752
11-15 11:39:34.435 19385 19472 W google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
11-15 11:39:34.435 19385 19472 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 19472 (RenderThread)
11-15 11:39:34.476  6436  6640 I WindowManager: Destroying surface Surface(name=org.kiwix.kiwixmobile/org.kiwix.kiwixmobile.zim_manager.ZimManageActivity_dim) called by com.android.server.wm.WindowStateAnimator.destroyTransitionDimSurface:2697 com.android.server.wm.WindowState.onExitAnimationDone:5189 com.android.server.wm.AppWindowAnimator.stepAnimationLocked:508 com.android.server.wm.AppWindowToken.stepAppWindowsAnimation:1659 com.android.server.wm.WindowContainer.stepAppWindowsAnimation:521 com.android.server.wm.WindowContainer.stepAppWindowsAnimation:521 com.android.server.wm.TaskStack.stepAppWindowsAnimation:1948 com.android.server.wm.WindowContainer.stepAppWindowsAnimation:521
11-15 11:39:34.477  4261  4344 I SurfaceFlinger: id=8204 Removed org.kiwix.kiwixmobile/org.kiwix.kiwixmobile.zim_manager.ZimManageActivity_dim#0 (4/10)
11-15 11:39:34.477  4261  4344 I SurfaceFlinger: id=8204 Removed org.kiwix.kiwixmobile/org.kiwix.kiwixmobile.zim_manager.ZimManageActivity_dim#0 (-2/10)
11-15 11:39:34.477  6436  6640 I WindowManager: Destroying surface Surface(name=PopupWindow:a61b457) called by com.android.server.wm.WindowStateAnimator.destroySurface:2465 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:967 com.android.server.wm.WindowState.destroyOrSaveSurfaceUnchecked:3651 com.android.server.wm.WindowState.destroySurface:3599 com.android.server.wm.WindowState.destroySurface:3581 com.android.server.wm.AppWindowToken.destroySurfaces:722 com.android.server.wm.AppWindowToken.destroySurfaces:706 com.android.server.wm.WindowState.onExitAnimationDone:5260
11-15 11:39:34.477  4261  4344 I SurfaceFlinger: id=8202 Removed PopupWindow:a61b457#0 (3/9)
11-15 11:39:34.478  6436  6522 D CustomFrequencyManagerService: acquireDVFSLockLocked : type : DVFS_MIN_LIMIT  frequency : 1794000  uid : 1000  pid : 6436  pkgName : AMS_RESUME_TAIL@CPU_MIN@24
11-15 11:39:34.478  6436  6522 D ActivityManagerPerformance: AMP_acquire() TAIL
11-15 11:39:34.478  6436  6522 D CustomFrequencyManagerService: FrequencyrequestList.getNextMaxCPUCoreRequest, index: 1
11-15 11:39:34.478  6436  6522 D CustomFrequencyManagerService: releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT  frequency : 1794000  uid : 1000  pid : 6436  tag : AMS_ACT_START@CPU_MIN@77
11-15 11:39:34.478  6436  6522 D ActivityManagerPerformance: AMP_release() ACT_START
11-15 11:39:34.481  4261  4261 I SurfaceFlinger: Display 0 HWC layers:
11-15 11:39:34.481  4261  4261 I SurfaceFlinger:     type    |    handle    | flag |  format   |   source crop (l,t,r,b)    |         frame       | name
11-15 11:39:34.481  4261  4261 I SurfaceFlinger: ------------+--------------+------+-----------+----------------------------+---------------------+------
11-15 11:39:34.481  4261  4261 I SurfaceFlinger:      Device | 0x759e040b20 | 0002 | RGBA_8888 |   0.0    0.0 1080.0 2220.0 |    0    0 1080 2220 | org.kiwix.kiwixmobile/org.kiwix.kiwixmobile.zim_manager.ZimManageActivity#0
11-15 11:39:34.481  4261  4261 I SurfaceFlinger:      Device | 0x759ee58e00 | 0000 | RGBA_8888 |   0.0    0.0 1080.0   72.0 |    0    0 1080   72 | StatusBar#0
11-15 11:39:34.481  4261  4261 I SurfaceFlinger:      Device | 0x759e03fb60 | 0000 | RGBA_8888 |   0.0    0.0   67.0  675.0 | 1013  860 1080 1535 | com.samsung.android.app.cocktailbars[...]ktailbarservice.CocktailBarService#0
11-15 11:39:34.481  4261  4261 I SurfaceFlinger:      Device | 0x759ee5b020 | 0000 | RGBA_8888 |   0.0    0.0 1080.0  144.0 |    0 2076 1080 2220 | NavigationBar#0
11-15 11:39:34.481  4261  4261 I SurfaceFlinger:
11-15 11:39:34.484 19544 19544 I crash_dump64: obtaining output fd from tombstoned
11-15 11:39:34.485  6268  6268 I /system/bin/tombstoned: received crash request for pid 19385
11-15 11:39:34.487 19544 19544 I crash_dump64: performing dump of process 19385 (target tid = 19472)
11-15 11:39:34.487 19544 19544 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-15 11:39:34.487 19544 19544 F DEBUG   : Build fingerprint: 'samsung/starltexx/starlte:8.0.0/R16NW/G960FXXU1ARD4:user/release-keys'
11-15 11:39:34.487 19544 19544 F DEBUG   : Revision: '26'
11-15 11:39:34.487 19544 19544 F DEBUG   : ABI: 'arm64'
11-15 11:39:34.487 19544 19544 F DEBUG   : pid: 19385, tid: 19472, name: RenderThread  >>> org.kiwix.kiwixmobile <<<
11-15 11:39:34.487 19544 19544 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
11-15 11:39:34.490 19544 19544 F DEBUG   : Abort message: 'Failed to make current on surface 0x747dc14760, error=EGL_NOT_INITIALIZED'
11-15 11:39:34.490 19544 19544 F DEBUG   :     x0   0000000000000000  x1   0000000000004c10  x2   0000000000000006  x3   0000000000000008
11-15 11:39:34.490 19544 19544 F DEBUG   :     x4   0000000000000000  x5   0000000000000000  x6   0000000000000000  x7   7f7f7f7f7f7f7f7f
11-15 11:39:34.490 19544 19544 F DEBUG   :     x8   0000000000000083  x9   9643445bf31ad031  x10  0000000000000000  x11  ffffffffffffffff
11-15 11:39:34.490 19544 19544 F DEBUG   :     x12  0000000000000038  x13  ffffffffffffffff  x14  ff00000000000000  x15  ffffffffffffffff
11-15 11:39:34.490 19544 19544 F DEBUG   :     x16  000000748d6d72f8  x17  000000748d6780ac  x18  0000000000000000  x19  0000000000004bb9
11-15 11:39:34.490 19544 19544 F DEBUG   :     x20  0000000000004c10  x21  0000000000000000  x22  000000744b66d898  x23  000000748d8a40dc
11-15 11:39:34.490 19544 19544 F DEBUG   :     x24  000000748d8a4040  x25  0000000000000001  x26  0000007461627328  x27  0000007461627328
11-15 11:39:34.490 19544 19544 F DEBUG   :     x28  000000000000000a  x29  0000007461626bf0  x30  000000748d62507c
11-15 11:39:34.490 19544 19544 F DEBUG   :     sp   0000007461626bb0  pc   000000748d6780b4  pstate 0000000060000000
11-15 11:39:34.491  4261  4344 I SurfaceFlinger: id=8202 Removed PopupWindow:a61b457#0 (-2/9)
11-15 11:39:34.493  4261  4261 I Layer   : id=8202 onRemoved PopupWindow:a61b457#0
11-15 11:39:34.493  4261  4261 I Layer   : id=8204 onRemoved org.kiwix.kiwixmobile/org.kiwix.kiwixmobile.zim_manager.ZimManageActivity_dim#0
11-15 11:39:34.516 19544 19544 F DEBUG   :
11-15 11:39:34.516 19544 19544 F DEBUG   : backtrace:
11-15 11:39:34.516 19544 19544 F DEBUG   :     #00 pc 00000000000710b4  /system/lib64/libc.so (tgkill+8)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #01 pc 000000000001e078  /system/lib64/libc.so (abort+88)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #02 pc 00000000000081d8  /system/lib64/liblog.so (__android_log_assert+312)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #03 pc 0000000000051f10  /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread10EglManager11makeCurrentEPvPi+240)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #04 pc 000000000005215c  /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread10EglManager14destroySurfaceEPv+44)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #05 pc 0000000000050468  /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread14OpenGLPipeline10setSurfaceEPNS_7SurfaceENS1_12SwapBehaviorE+40)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #06 pc 000000000004cdd4  /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread13CanvasContext10setSurfaceEPNS_7SurfaceE+148)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #07 pc 000000000004d960  /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread13CanvasContext4drawEv+256)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #08 pc 00000000000512e8  /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread13DrawFrameTask3runEv+184)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #09 pc 0000000000058784  /system/lib64/libhwui.so (_ZN7android10uirenderer12renderthread12RenderThread10threadLoopEv+356)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #10 pc 0000000000011b78  /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+264)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #11 pc 00000000000fd638  /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+136)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #12 pc 000000000006d6d4  /system/lib64/libc.so (_ZL15__pthread_startPv+36)
11-15 11:39:34.516 19544 19544 F DEBUG   :     #13 pc 000000000001f9b4  /system/lib64/libc.so (__start_thread+68)
11-15 11:39:34.862  6436  6436 D CustomFrequencyManagerService: releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT  frequency : 1794000  uid : 1000  pid : 6436  tag : AMS_RESUME_TAIL@CPU_MIN@24
11-15 11:39:35.133  6268  6268 E /system/bin/tombstoned: Tombstone written to: /data/tombstones//tombstone_08
11-15 11:39:35.138  6024  6024 E audit   : type=1701 audit(1542310775.134:31105): auid=4294967295 uid=10502 gid=10502 ses=4294967295 subj=u:r:untrusted_app:s0:c512,c768 pid=19385 comm="RenderThread" exe="/system/bin/app_process64" sig=6
11-15 11:39:35.140  6436 19545 W ActivityManager: crash : org.kiwix.kiwixmobile,0
11-15 11:39:35.142  6436 19545 W ActivityManager:   Force finishing activity org.kiwix.kiwixmobile/.zim_manager.ZimManageActivity
11-15 11:39:35.147  9994 22850 I TrayUsageStatesWatcher: notePauseComponent : ComponentInfo{org.kiwix.kiwixmobile/org.kiwix.kiwixmobile.zim_manager.ZimManageActivity}
11-15 11:39:35.154  6436 19545 W ActivityManager:   Force finishing activity org.kiwix.kiwixmobile/.KiwixMobileActivity
11-15 11:39:35.159  6436 19545 W MultiScreenManagerService: moveTaskBackToDisplayIfNeeded(): root activity or app is null, task=TaskRecord{590233ad0 #1763 A=org.kiwix.kiwixmobile U=0 StackId=1 sz=2}, rootActivity=null
11-15 11:39:35.159  6436 19546 W DropBoxManagerService: Dropping: data_app_native_crash (2918 > 0 bytes)
11-15 11:39:35.159  6436  6436 D CodecSolution: MultiWindowEventListener::onMultiWindowFocusChanged(0)
11-15 11:39:35.160  6436  6436 D MdnieScenarioControlService: Listener Real Multi Window State : true
11-15 11:39:35.160  6436  6436 D CS_HdrController: MultiWindowEventListener::onFocusStackChanged(0)
11-15 11:39:35.164  6436 19545 D InputDispatcher: Focus left window: 19385

@Aditya-Sood
Copy link
Contributor

The error seems to be some code blocking the UI thread
I'll try some files created on zimmer

@Aditya-Sood
Copy link
Contributor

@metal450 I'm repeatedly running into the following error when running node wikizimmer http://prepaid-data-sim-card.wikia.com/wiki/Alaska on my Ubuntu machine:

***/zimmer/wikizimmer.js:336
    async getData () {
          ^^^^^^^

SyntaxError: Unexpected identifier
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:383:7)
    at startup (bootstrap_node.js:149:9)

Are your instructions missing some set-up commands?

@metal450
Copy link
Author

metal450 commented Dec 2, 2018

I'm on Windows & I did already have Node setup...but other than that, nope.

If you prefer, I can just send you the zim...?

@kelson42
Copy link
Collaborator

kelson42 commented Dec 2, 2018

@metal450 I don't think we can really help here without you having published the ZIM file.

@kelson42 kelson42 added the bug label Dec 2, 2018
@Aditya-Sood
Copy link
Contributor

@metal450 that would be great - Just share the drive link to both the ZIMs that you'd created

@Aditya-Sood
Copy link
Contributor

@kelson42 I couldn't get the ZIM creator to work, will try and recreate the error with the shared files

@kelson42
Copy link
Collaborator

kelson42 commented Dec 2, 2018

@Aditya-Sood I don't understand at all why zimmer has been started!... So let just wait we get the file before investing to much time here IMO.

@metal450
Copy link
Author

metal450 commented Dec 2, 2018

Here's the zim: https://www.dropbox.com/s/0xch0rqj1lct0j0/prepaid-data-sim-card.wikia.com.zim?dl=0

:)

@Aditya-Sood
Copy link
Contributor

@kelson42 Is it possible that the contents of the ZIM file are dependent on the program creating it?

Becuase while I couldn't find any answers to the problem online, related solutions and re-reading the errors all hint at this new file invoking stuff which the Kiwix downloaded ZIMs don't when opened

The error apparently occurs as soon as the app discovers and tries to parse this new file during the initial scan for ZIMs upon launch

In-app Logs:

(From the Kiwix/ directory on the phone)

.
.
.
.
12-22 04:38:33.227  4799  4927 I kiwix   : Attempting to create reader with: /storage/emulated/0/Zims/psiram_en_all_nopic_2018-10.zim
12-22 04:38:33.228  4799  4927 I kiwix   : Opening ZIM file /storage/emulated/0/Zims/psiram_en_all_nopic_2018-10.zim
12-22 04:38:33.229  4799  4927 I kiwix   : Attempting to create reader with: /storage/emulated/0/Kiwix/prepaid-data-sim-card.wikia.com.zim
12-22 04:38:33.236  4799  4927 I kiwix   : Opening ZIM file /storage/emulated/0/Kiwix/prepaid-data-sim-card.wikia.com.zim
--------- beginning of crash

Stack Trace:

12-22 04:21:09.844 27527-27527/? E/SchedPolicy: open of /dev/cpuctl/bg_non_interactive/tasks failed: No such file or directory
.
.
.
.
.
12-22 04:21:10.022 2887-3947/? I/ActivityManager: START u0     {cmp=org.kiwix.kiwixmobile/.main.MainActivity} from uid 10179
12-22 04:21:10.223 27507-27507/org.kiwix.kiwixmobile I/WebViewFactory: Loading com.android.chrome version 70.0.3538.110 (code 353811002)
12-22 04:21:10.273 27507-27507/org.kiwix.kiwixmobile I/zygote: Rejecting re-init on previously-failed class java.lang.Class<uO>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/TracingController;
12-22 04:21:10.273 27507-27507/org.kiwix.kiwixmobile I/zygote:     at 
.
.
.
.
.
.
12-22 04:21:11.816 27507-27589/org.kiwix.kiwixmobile E/SQLiteLog: (1) no such table: History
12-22 04:21:11.821 27507-27589/org.kiwix.kiwixmobile E/MainPresenter: Unable to save history
                                                                  android.database.sqlite.SQLiteException: no such table: History (code 1): , while compiling: DELETE FROM History WHERE ((History.historyUrl=?) AND (History.date=?) AND (History.zimId=?))
                                                                      at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
                                                                      at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:890)
                                                                      at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:501)
                                                                      at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
                                                                      at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
                                                                      at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
                                                                      at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:1070)
                                                                      at com.yahoo.squidb.data.adapter.SQLiteDatabaseAdapter.executeUpdateDelete(SQLiteDatabaseAdapter.java:332)
                                                                      at com.yahoo.squidb.data.SquidDatabase.deleteInternal(SquidDatabase.java:649)
                                                                      at com.yahoo.squidb.data.SquidDatabase.deleteWhere(SquidDatabase.java:1475)
                                                                      at org.kiwix.kiwixmobile.data.local.dao.HistoryDao.saveHistory(HistoryDao.java:34)
                                                                      at org.kiwix.kiwixmobile.data.Repository.lambda$saveHistory$7(Repository.java:133)
                                                                      at org.kiwix.kiwixmobile.data.-$$Lambda$Repository$aFmoO5g4eZJp_rS8Bfa24NUOnxA.run(Unknown Source:4)
                                                                      at io.reactivex.internal.operators.completable.CompletableFromAction.subscribeActual(CompletableFromAction.java:34)
                                                                      at io.reactivex.Completable.subscribe(Completable.java:2185)
                                                                      at io.reactivex.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
                                                                      at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
                                                                      at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
                                                                      at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
                                                                      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                                                                      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
                                                                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
                                                                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                                                                      at java.lang.Thread.run(Thread.java:764)

@Aditya-Sood
Copy link
Contributor

Also, this is an entirely different error from the one faced by @metal450 on his device, which was a ...Fatal signal 6 (SIGABRT), code -6... error about some blocking process on the UI thread

@mhutti1
Copy link
Contributor

mhutti1 commented Dec 23, 2018

@Aditya-Sood If you wipe the apps data do you get the same error?

@Aditya-Sood
Copy link
Contributor

@mhutti1 it's slightly different upon reinstalling
The error related to History table is gone, but the other two remain along with a new one about an exception:

12-31 16:01:19.350 27451-27529/org.kiwix.kiwixmobile E/kiwix: Exception reading article A/Main_Page.html from zim file
                                                          java.io.IOException: write failed: EPIPE (Broken pipe)
                                                              at libcore.io.IoBridge.write(IoBridge.java:558)
                                                              at java.io.FileOutputStream.write(FileOutputStream.java:326)
                                                              at org.kiwix.kiwixmobile.data.ZimContentProvider$TransferThread.run(ZimContentProvider.java:490)
                                                           Caused by: android.system.ErrnoException: write failed: EPIPE (Broken pipe)
                                                              at libcore.io.Linux.writeBytes(Native Method)
                                                              at libcore.io.Linux.write(Linux.java:288)
                                                              at libcore.io.BlockGuardOs.write(BlockGuardOs.java:345)
                                                              at libcore.io.IoBridge.write(IoBridge.java:553)
                                                              at java.io.FileOutputStream.write(FileOutputStream.java:326) 
                                                              at org.kiwix.kiwixmobile.data.ZimContentProvider$TransferThread.run(ZimContentProvider.java:490) 

Entire stack trace for additional context here

@Aditya-Sood
Copy link
Contributor

Is it possible that this ZIM file is structured in a different manner from how kiwix creates the same?

@mhutti1
Copy link
Contributor

mhutti1 commented Jan 1, 2019

@Aditya-Sood i'm not sure. Broken pipe might imply that there's too much data trying to be read?

@Aditya-Sood
Copy link
Contributor

@mhutti1 the error write failed: EPIPE (Broken pipe) apparently occurs when the app tries to execute a root command without the permission to do so

I went over the stacktrace and found this error: 12-31 16:01:18.244 27489-27489/? E//system/bin/webview_zygote32: Failed to make and chown /acct/uid_99935: Permission denied, and chown requires root privilege

@Aditya-Sood
Copy link
Contributor

So chown is probably the 'root' of the error here, but we don't request root access in the manifest as of now. Should we leave it on the back-burner until one of our own ZIMs raises the error?

@metal450
Copy link
Author

metal450 commented Jan 5, 2019

Should we leave it on the back-burner until one of our own ZIMs raises the error?

...Fingers crossed that you don't. Having this wiki on my phone while I travel internationally would be extremely useful, & I've been waiting super eagerly as I follow this thread hoping for a fix :/

@kelson42
Copy link
Collaborator

kelson42 commented Jan 6, 2019

@Aditya-Sood Which exact piece of code of Kiwix-Android does a chown?

@Aditya-Sood
Copy link
Contributor

@kelson42 I think the chown was hinted at by the write failed: EPIPE (Broken pipe) error, which was caused by the OutputStream object in ZimContentProvider here

@Aditya-Sood
Copy link
Contributor

Interestingly though, there are additional errors which aren't highlighted in red by android studio and don't necessarily occur always:

  1. There was a TracingController class not found error, fixed by lowering the target and min sdk versions to 27 & 26. This occurs only for this zim, not in its absence

  2. A bunch of additional lines correlating to error in some javascript files (that I couldn't find in the project directory):

01-12 17:29:41.196 22180-22231/org.kiwix.kiwixmobile D/kiwix: Retrieving: content://org.kiwix.kiwixmobile.zim.base/-/s/style.css
01-12 17:29:41.199 22180-22235/org.kiwix.kiwixmobile D/kiwix: Retrieving: content://org.kiwix.kiwixmobile.zim.base/-/s/css_modules/mediawiki.toc.css
01-12 17:29:41.201 22180-22231/org.kiwix.kiwixmobile D/kiwix: Retrieving: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/startup.js
01-12 17:29:41.205 22180-22235/org.kiwix.kiwixmobile D/kiwix: Retrieving: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/jquery.js
01-12 17:29:41.205 22180-22240/org.kiwix.kiwixmobile D/kiwix: Retrieving: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/jsConfigVars.js
01-12 17:29:41.206 22180-22231/org.kiwix.kiwixmobile D/kiwix: Retrieving: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/mediawiki.js
01-12 17:29:41.206 22180-22282/org.kiwix.kiwixmobile D/kiwix: reading  -/s/style.css(mime: text/css, size: 43736) finished.
01-12 17:29:41.207 22180-22283/org.kiwix.kiwixmobile D/kiwix: reading  -/s/css_modules/mediawiki.toc.css(mime: text/css, size: 208) finished.
01-12 17:29:41.210 22180-22235/org.kiwix.kiwixmobile D/kiwix: Retrieving: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/site.js
01-12 17:29:41.211 22180-22284/org.kiwix.kiwixmobile D/kiwix: reading  -/j/js_modules/startup.js(mime: application/javascript, size: 208) finished.
01-12 17:29:41.213 22180-22285/org.kiwix.kiwixmobile D/kiwix: reading  -/j/js_modules/jquery.js(mime: application/javascript, size: 208) finished.
01-12 17:29:41.216 22180-22228/org.kiwix.kiwixmobile D/kiwix: Getting mime-type for content://org.kiwix.kiwixmobile.zim.base/-/s/style.css = text/css
01-12 17:29:41.217 22180-22287/org.kiwix.kiwixmobile D/kiwix: reading  -/j/js_modules/mediawiki.js(mime: application/javascript, size: 428) finished.
01-12 17:29:41.218 22180-22228/org.kiwix.kiwixmobile D/kiwix: Getting mime-type for content://org.kiwix.kiwixmobile.zim.base/-/s/style.css = text/css
01-12 17:29:41.219 22180-22240/org.kiwix.kiwixmobile D/kiwix: Retrieving: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/mediawiki.toc.js
01-12 17:29:41.223 22180-22228/org.kiwix.kiwixmobile D/kiwix: Getting mime-type for content://org.kiwix.kiwixmobile.zim.base/-/s/css_modules/mediawiki.toc.css = text/css
01-12 17:29:41.224 22180-22288/org.kiwix.kiwixmobile D/kiwix: reading  -/j/js_modules/site.js(mime: application/javascript, size: 208) finished.
01-12 17:29:41.224 22180-22286/org.kiwix.kiwixmobile D/kiwix: reading  -/j/js_modules/jsConfigVars.js(mime: application/javascript, size: 998) finished.
01-12 17:29:41.225 22180-22228/org.kiwix.kiwixmobile D/kiwix: Getting mime-type for content://org.kiwix.kiwixmobile.zim.base/-/s/css_modules/mediawiki.toc.css = text/css
01-12 17:29:41.228 22180-22228/org.kiwix.kiwixmobile W/ContentResolver: Failed to get type for: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/startup.js (Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference)
01-12 17:29:41.230 22180-22228/org.kiwix.kiwixmobile W/ContentResolver: Failed to get type for: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/startup.js (Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference)
01-12 17:29:41.230 22180-22289/org.kiwix.kiwixmobile D/kiwix: reading  -/j/js_modules/mediawiki.toc.js(mime: application/javascript, size: 208) finished.
01-12 17:29:41.233 22180-22228/org.kiwix.kiwixmobile W/ContentResolver: Failed to get type for: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/jquery.js (Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference)
01-12 17:29:41.234 22180-22228/org.kiwix.kiwixmobile W/ContentResolver: Failed to get type for: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/jquery.js (Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference)
01-12 17:29:41.237 22180-22228/org.kiwix.kiwixmobile W/ContentResolver: Failed to get type for: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/jsConfigVars.js (Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference)
01-12 17:29:41.239 22180-22228/org.kiwix.kiwixmobile W/ContentResolver: Failed to get type for: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/jsConfigVars.js (Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference)
01-12 17:29:41.241 22180-22228/org.kiwix.kiwixmobile W/ContentResolver: Failed to get type for: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/mediawiki.js (Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference)
01-12 17:29:41.243 22180-22228/org.kiwix.kiwixmobile W/ContentResolver: Failed to get type for: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/mediawiki.js (Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference)
01-12 17:29:41.247 22180-22228/org.kiwix.kiwixmobile W/ContentResolver: Failed to get type for: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/site.js (Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference)
01-12 17:29:41.249 22180-22228/org.kiwix.kiwixmobile W/ContentResolver: Failed to get type for: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/site.js (Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference)
01-12 17:29:41.253 22180-22228/org.kiwix.kiwixmobile W/ContentResolver: Failed to get type for: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/mediawiki.toc.js (Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference)
01-12 17:29:41.255 22180-22228/org.kiwix.kiwixmobile W/ContentResolver: Failed to get type for: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/mediawiki.toc.js (Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference)
01-12 17:29:41.303 22180-22260/org.kiwix.kiwixmobile I/kiwix: Attempting to create reader with: /storage/3836-6333/prepaid-data-sim-card.wikia.com.zim
01-12 17:29:41.310 22180-22260/org.kiwix.kiwixmobile I/kiwix: Opening ZIM file /storage/3836-6333/prepaid-data-sim-card.wikia.com.zim
  1. Sometimes point (2) was followed by these lines:
01-12 17:13:32.457 21314-21314/org.kiwix.kiwixmobile I/chromium: [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/startup.js (1)
01-12 17:13:32.457 21314-21314/org.kiwix.kiwixmobile I/chromium: [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/jquery.js (1)
01-12 17:13:32.457 21314-21314/org.kiwix.kiwixmobile I/chromium: [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/mediawiki.js (1)
01-12 17:13:32.458 21314-21314/org.kiwix.kiwixmobile I/chromium: [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/site.js (1)
01-12 17:13:32.458 21314-21314/org.kiwix.kiwixmobile I/chromium: [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token <", source: content://org.kiwix.kiwixmobile.zim.base/-/j/js_modules/mediawiki.toc.js (1)

@Aditya-Sood
Copy link
Contributor

Are there javascript files within a zim file, to help with parsing and other stuff?

@Aditya-Sood
Copy link
Contributor

@metal450 can you share more zims created through zimmer?

@metal450
Copy link
Author

Sure, here's another I just made from a different random wiki: https://www.dropbox.com/s/dsumhpixcrohpyu/magnumpi.wikia.com.zim?dl=0

@Aditya-Sood
Copy link
Contributor

TL;DR - I have hit a total dead end on this bug, with no hints to the cause or solution online. Unless you have any ideas for how to tackle this, I'd like to put this bug aside and focus on other open issues.

Final Update:

@kelson42 I think the chown was hinted at by the write failed: EPIPE (Broken pipe) error, which was caused by the OutputStream object in ZimContentProvider here

I didn't check this earlier, but the error pops up (& is handled without crashing) in the absence of the files as well. So a broken pipe has nothing to do with it.

What does repeatedly occur is the following:

2019-02-10 01:39:16.693 25635-25635/? E//system/bin/webview_zygote32: Failed to make and chown /acct/uid_99418: Permission denied
2019-02-10 01:39:16.693 25635-25635/? E/Zygote: createProcessGroup(99418, 0) failed: Permission denied
2019-02-10 01:39:16.694 25635-25635/? E/SchedPolicy: open of /dev/cpuctl/bg_non_interactive/tasks failed: No such file or directory
.
.
.
2019-02-10 01:39:18.346 2780-2840/? W/zygote: Failed to open process cgroup uid 99418 pid 25635: No such file or directory
2019-02-10 01:39:18.346 2780-2840/? E/zygote: Error encountered killing process cgroup uid 99418 pid 25635: No such file or directory

Now open of /dev/cpuctl/bg_non_interactive/tasks failed: No such file or directory is a very generic error and doesn't offer much indication to the cause or solution from my searches.

And responses to E//system/bin/webview_zygote32: Failed to make and chown /acct/uid_99418: Permission denied are just as bleak.
The two responses I could find to webview_zygote:

  1. Suggests creating a new project and moving all the modules to it one by one

  2. Suggests playing around with version codes and the order of compiling dependencies

All in all, @mhutti1 @kelson42 I have hit a dead end. So unless you have any suggestions for how to solve this, I plan to leave this bug and start focussing on other open issues.

@metal450
Copy link
Author

If this isn't ultimately going to be fixed...is there any other workaround/way I can get the data from http://prepaid-data-sim-card.wikia.com/wiki/Prepaid_SIM_with_data to work in Kiwix...?

@kelson42
Copy link
Collaborator

@metal450 Sorry for the lack of feedback. I have put the ticket in 2.5. I suspect a problem with the core library. We will see. Thank you for your patience.

@kelson42 kelson42 added this to the 2.5 milestone Apr 19, 2019
@metal450
Copy link
Author

Sounds good, thanks again for following up.

@macgills macgills modified the milestones: 2.5, 3.0 May 27, 2019
@stale
Copy link

stale bot commented Jul 26, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label Jul 26, 2019
@metal450
Copy link
Author

I just re-tested this, & it looks like it's at long last fixed :)

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

5 participants