Closed raveit65 closed 8 years ago
downstream report about. https://bugzilla.redhat.com/show_bug.cgi?id=1333811 Sam Tygier 2016-05-06 09:15:00 EDT
Description of problem: I was running a script that regenerated some PDF files, which were open atril. I'd guess atril tried to reload them at the same time that they were being writen.
hlx98007@gmail.com 2016-05-07 16:11:15 EDT
Similar problem has been detected:
Open the PDF (generated by xelatex), while still opening it, change the content of the tex and recompile the tex file to override the PDF, atril crashes.
Sam Tygier 2016-05-09 10:28:00 EDT
Reload from the menu also crashes 1.12.2-2.fc23.
If I revert to atril-1.12.2-1.fc23.x86_64 (from http://koji.fedoraproject.org/koji/buildinfo?buildID=707544 ), then I don't get the crash from either updating the PDF or reload from the menu.
next downstream report https://bugzilla.redhat.com/show_bug.cgi?id=1334513
I reverted the commit from fedora/rhel7 builds.
Dammit... :confused:
It looks like there's still something wrong in the code as I get a lot of warnings when reloading a pdf document (after reverting e9ff838f4de64653799c8a8b79610ad073e8a52c):
(atril:3292): Gtk-CRITICAL **: IA__gtk_widget_get_parent: assertion 'GTK_IS_WIDGET (widget)' failed
(atril:3292): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'EvWebView'
(atril:3292): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(atril:3292): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(atril:3292): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(atril:3292): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(atril:3292): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(atril:3292): GLib-GObject-CRITICAL **: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(atril:3292): GLib-GObject-CRITICAL **: g_object_ref_sink: assertion 'G_IS_OBJECT (object)' failed
(atril:3292): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
@rootAvish: can you please take a look at this?
@rootAvish: I don't get it... why check for both conditions here? what's the point? :confused:
GtkWidget *parent= gtk_widget_get_parent(ev_window->priv->webview);
if (document->iswebdocument == TRUE &&
parent == NULL )
{
/*We have encountered a web document, replace the atril view with a web view, if the web view is not already loaded.*/
gtk_container_remove (GTK_CONTAINER(ev_window->priv->scrolled_window),
ev_window->priv->view);
ev_view_disconnect_handlers(EV_VIEW(ev_window->priv->view));
g_object_unref(ev_window->priv->view);
ev_window->priv->view = NULL;
gtk_container_add (GTK_CONTAINER (ev_window->priv->scrolled_window),
ev_window->priv->webview);
gtk_widget_show(ev_window->priv->webview);
}
else {
/*Since the document is not a webdocument might as well get rid of the webview now*/
ev_web_view_disconnect_handlers(EV_WEB_VIEW(ev_window->priv->webview));
g_object_ref_sink(ev_window->priv->webview);
g_object_unref(ev_window->priv->webview);
}
I don't remember all too well at this point, but from what I can gather the second check is to check whether a webview is already docked inside the Atril window, the first one to check whether it's an ePub.
Well, this doesn't seem right to me. If the first condition is true (it's a webdoc) but the webview has a parent, we move to else branch and try to delete the webview...
Also there's no check if we already deleted the webview, hence the bunch of warnings after you reload a PDF doc, and some occasional crashes (and a certain crash if you add e9ff838f4de64653799c8a8b79610ad073e8a52c).
I'm trying to understand the intended logic here in order to fix the mentioned issues...
@rootAvish To be clear without https://github.com/mate-desktop/atril/commit/e9ff838f4de64653799c8a8b79610ad073e8a52c atril can crash in this function. I have 3 bugreports about. https://bugzilla.redhat.com/show_bug.cgi?id=1303999 https://bugzilla.redhat.com/show_bug.cgi?id=1324444 https://bugzilla.redhat.com/show_bug.cgi?id=1330202
As I understand, the random crash is due to gtk_widget_get_parent
trying to access the already-freed memory (the pointer isn't properly set to NULL
after unref).
@raveit65: guess we can close this now since #201 is merged?
With latest build from master atril crashes if i reload the document. My results:
f23, Mate gtk3, webkitgtk4-2.12.2-2, atril-1.14.0 unpatched, no crash
After reloading the epub i can't select a page anymore with the thumbnail in sidebar. But previous and next button in toolbar are working.
f23, Mate gtk3, webkitgtk4-2.12.2-2, atril-1.14.0 + latest commit
stacktrace:
full stacktrace: https://dl.dropboxusercontent.com/u/49862637/Mate-desktop/Bugs/atril-stacktrace-pdf
full stacktrace: https://dl.dropboxusercontent.com/u/49862637/Mate-desktop/Bugs/atril-stacktrace-epub
So the question is why webkit is involved with using pdf ? I looks like that both crashes happens in webkit code.