GNOME Bugzilla – Bug 780707
Crashes going back and forth between epubs
Last modified: 2017-03-31 05:50:33 UTC
libgepub-0.4-2.fc26.x86_64 gnome-books-3.23.91-1.fc26.x86_64
+ Trace 237299
$2 = (GepubDoc *) 0x55f92335f540 (gdb) p doc->page $3 = (GList *) 0x0 Oops
How do you reproduce this? I tried with a few epubs and moving back/forward between their pages and could not make it crash.
(In reply to Cosimo Cecchi from comment #1) > How do you reproduce this? I tried with a few epubs and moving back/forward > between their pages and could not make it crash. Not between pages, but between epubs. I can't reproduce this on my desktop machine, possibly because it's too quick.
Created attachment 348984 [details] [review] libgepub: Add guards to public functions So as to catch incorrect usage of the APIs as soon as possible.
Patch for pre-rust libgepub, need to see whether that catches something in my reproducer.
Reproducer: - open comics (evince view) - go back before it's finished loading - click on epub view With the above patch: ** (org.gnome.Books:6333): CRITICAL **: gepub_doc_get_current: assertion 'doc->page != NULL' failed (gdb) call gjs_dumpstack() == Stack trace for context 0x555555782050 == EPUBView<.onLoadFinished@resource:///org/gnome/Books/js/epubview.js:89:9 wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22 _emit@resource:///org/gnome/gjs/modules/signals.js:126:27 DocumentManager<._onDocumentLoaded@resource:///org/gnome/Books/js/documents.js:1371:9 wrapper@resource:///org/gnome/gjs/modules/lang.js:178:22 DocCommon<.loadLocal/<@resource:///org/gnome/Books/js/documents.js:626:21 main@resource:///org/gnome/Books/js/main.js:47:12 run@resource:///org/gnome/gjs/modules/package.js:192:12 @/usr/bin/gnome-books:6:1 $1 = 1433768880 (gdb) bt
+ Trace 237300
I think you can make this much more easily by making gd_pdf_loader_load_uri_async() take ages. Or loading a huge CBZ/CBR file.
Managed to reproduce and pushed a fix to master. The following fixes have been pushed: e462682 pdf-loader: make sure to cancel load job 1b1346f documents: factor out a common function
Created attachment 349024 [details] [review] pdf-loader: make sure to cancel load job Otherwise we will get a load-succeeded signal in the views, instead of a cancelled error, which will end up loading a wrong document, leading to a crash.
Created attachment 349025 [details] [review] documents: factor out a common function
Comment on attachment 348984 [details] [review] libgepub: Add guards to public functions Pushed to libgepub master as well. Attachment 348984 [details] pushed as 0da0ba3 - libgepub: Add guards to public functions