Bug 98497

Summary: [GTK] Test /webkit2/WebKitPrintOperation/print-errors gives runtime critical warnings
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: gustavo, xan.lopez
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch mrobinson: review+

Description Carlos Garcia Campos 2012-10-05 01:38:41 PDT
GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel->is_writeable' failed

This is because GTK+ tries to write in the io channel that has already been closed.
Comment 1 Carlos Garcia Campos 2012-10-05 01:42:11 PDT
Created attachment 167280 [details]
Patch
Comment 2 Martin Robinson 2012-10-05 08:22:05 PDT
Comment on attachment 167280 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=167280&action=review

Looks good, but please see below before landing...

> Source/WebKit2/ChangeLog:9
> +        The problem is that GTK+ tries to write in the io channel that ash
> +        already been closed.

Nit: IO channel that has

> Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:700
> +        cairo_surface_finish(surface);

Since this is a work-around for a GTK+ bug it's probably a good idea to put a comment here including  a URL to the GTK+ bug in question.
Comment 3 Carlos Garcia Campos 2012-10-05 08:29:15 PDT
(In reply to comment #2)
> (From update of attachment 167280 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=167280&action=review
> 
> Looks good, but please see below before landing...
> 
> > Source/WebKit2/ChangeLog:9
> > +        The problem is that GTK+ tries to write in the io channel that ash
> > +        already been closed.
> 
> Nit: IO channel that has

Sure.

> > Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:700
> > +        cairo_surface_finish(surface);
> 
> Since this is a work-around for a GTK+ bug it's probably a good idea to put a comment here including  a URL to the GTK+ bug in question.

It's not exactly a workaround, it's a good idea to do that in any case even if there weren't bugs in GTK+, we are already doing it in WebPrintOperationGtkUnix::endPrint() and it's reason why it didn't fail for other printing errors.
Comment 4 Carlos Garcia Campos 2012-10-05 08:33:17 PDT
What I mean is that it would be useful to add links to the bugs there to remove the workaround when the bugs are fixed, but it's not the case, we want to finish the surface early even if the bugs are fixed.
Comment 5 Carlos Garcia Campos 2012-10-05 08:46:07 PDT
Committed r130509: <http://trac.webkit.org/changeset/130509>