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

FiX ANR #4136

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

CalebKL
Copy link
Contributor

@CalebKL CalebKL commented Dec 11, 2024

Same as PR.
@MohitMaliFtechiz I am still getting a native crash as showed below while switching to different ZimFiles
Check the logs below

   A  Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 29913 (DefaultDispatch), pid 28793 (wix.kiwixmobile)
2024-12-11 19:50:41.634 28793-29014 ZimFileReader           org.kiwix.kiwixmobile                E  Could not get Item for url = https://kiwix.app/favicon.ico 
                                                                                                     original exception = java.lang.Exception: Cannot find entry
2024-12-11 19:50:41.634 28793-29912 ZimFileReader           org.kiwix.kiwixmobile                E  Could not get Item for url = https://kiwix.app/favicon.ico 
                                                                                                     original exception = java.lang.Exception: Cannot find entry
2024-12-11 19:50:41.686 28793-29752 ZimFileReader           org.kiwix.kiwixmobile                E  error writing pipe for https://kiwix.app/100r.co/media/content/about/galley.png
                                                                                                    java.io.IOException: Pipe closed
                                                                                                    	at java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:263)
                                                                                                    	at java.io.PipedInputStream.awaitSpace(PipedInputStream.java:271)
                                                                                                    	at java.io.PipedInputStream.receive(PipedInputStream.java:234)
                                                                                                    	at java.io.PipedOutputStream.write(PipedOutputStream.java:149)
                                                                                                    	at java.io.OutputStream.write(OutputStream.java:127)
                                                                                                    	at org.kiwix.kiwixmobile.core.reader.ZimFileReader.streamZimContentToPipe$lambda$9(ZimFileReader.kt:332)
                                                                                                    	at org.kiwix.kiwixmobile.core.reader.ZimFileReader.$r8$lambda$xAxP9h44j1BuVVZuvI4NlYItXhA(Unknown Source:0)
                                                                                                    	at org.kiwix.kiwixmobile.core.reader.ZimFileReader$$ExternalSyntheticLambda0.run(Unknown Source:8)
                                                                                                    	at io.reactivex.internal.operators.completable.CompletableFromAction.subscribeActual(CompletableFromAction.java:35)
                                                                                                    	at io.reactivex.Completable.subscribe(Completable.java:2309)
                                                                                                    	at io.reactivex.internal.operators.completable.CompletableSubscribeOn$SubscribeOnObserver.run(CompletableSubscribeOn.java:64)
                                                                                                    	at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:608)
                                                                                                    	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:264)
                                                                                                    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)
2024-12-11 19:50:42.432 30024-30024 DEBUG                   crash_dump64                         A  Cmdline: org.kiwix.kiwixmobile
2024-12-11 19:50:42.432 30024-30024 DEBUG                   crash_dump64                         A  pid: 28793, tid: 29913, name: DefaultDispatch  >>> org.kiwix.kiwixmobile <<<
2024-12-11 19:50:42.432 30024-30024 DEBUG                   crash_dump64                         A        #00 pc 0000000000010630  /data/app/~~8k0XMlTVwBy5Oe5fvX0CTg==/org.kiwix.kiwixmobile-R9LGRdsHTRPDneJE6F1ovQ==/base.apk!libzim_wrapper.so (offset 0x616000) (Java_org_kiwix_libzim_Archive_getEntryByPath__Ljava_lang_String_2+120) (BuildId: bb96395f5068f1755a93f5daa08b7a934333f07e)
2024-12-11 19:50:42.432 30024-30024 DEBUG                   crash_dump64                         A        #02 pc 00000000021b8ddc  /memfd:jit-cache (deleted) (offset 0x2000000) (org.kiwix.kiwixmobile.core.reader.ZimFileReader.getItem+332)
2024-12-11 19:50:42.432 30024-30024 DEBUG                   crash_dump64                         A        #03 pc 00000000021e2f3c  /memfd:jit-cache (deleted) (offset 0x2000000) (org.kiwix.kiwixmobile.core.reader.ZimFileReader.loadContent+172)
2024-12-11 19:50:42.432 30024-30024 DEBUG                   crash_dump64                         A        #08 pc 00000000000062b8  <anonymous:78bffb3000> (org.kiwix.kiwixmobile.core.reader.ZimFileReader.access$loadContent+0)
2024-12-11 19:50:42.432 30024-30024 DEBUG                   crash_dump64                         A        #12 pc 00000000021bbee4  /memfd:jit-cache (deleted) (offset 0x2000000) (org.kiwix.kiwixmobile.core.reader.ZimFileReader$load$2.invokeSuspend+1972)

CalebKL and others added 3 commits December 11, 2024 10:56
@MohitMaliFtechiz
Copy link
Collaborator

@CalebKL Please use coreReaderLifeCycleScope instead of lifecycleScope. Since we are using the navigation graph in our application so when switching to the "Library" screen, the lifeCycle scope is active and continues executing the previous ZIM file creation. As it is not fully destroyed.

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

Successfully merging this pull request may close these issues.

3 participants