<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>98002</bug_id>
          
          <creation_ts>2012-10-01 01:51:11 -0700</creation_ts>
          <short_desc>WebPrintOperationGtk destructor should be virtual</short_desc>
          <delta_ts>2012-10-02 14:24:16 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit2</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Alberto Garcia">berto</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cgarcia</cc>
    
    <cc>mrobinson</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>731487</commentid>
    <comment_count>0</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2012-10-01 01:51:11 -0700</bug_when>
    <thetext>In file included from ../../Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.h:32:0,
                 from ../../Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:27:
../../Source/WTF/wtf/RefCounted.h: In instantiation of ‘void WTF::RefCounted&lt;T&gt;::deref() [with T = WebKit::WebPrintOperationGtk]’:
../../Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:158:31:   required from here
../../Source/WTF/wtf/RefCounted.h:190:13: warning: deleting object of abstract class type ‘WebKit::WebPrintOperationGtk’ which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>731496</commentid>
    <comment_count>1</comment_count>
      <attachid>166429</attachid>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2012-10-01 02:05:31 -0700</bug_when>
    <thetext>Created attachment 166429
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>731550</commentid>
    <comment_count>2</comment_count>
      <attachid>166429</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-10-01 04:01:31 -0700</bug_when>
    <thetext>Comment on attachment 166429
Patch

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>731559</commentid>
    <comment_count>3</comment_count>
      <attachid>166429</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-10-01 04:12:01 -0700</bug_when>
    <thetext>Comment on attachment 166429
Patch

Clearing flags on attachment: 166429

Committed r130028: &lt;http://trac.webkit.org/changeset/130028&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>731560</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-10-01 04:12:04 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>732670</commentid>
    <comment_count>5</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2012-10-02 08:35:52 -0700</bug_when>
    <thetext>This patch broke unit tests, see

/webkit2/WebKitPrintOperation/printing-settings: OK
/webkit2/WebKitWebView/print: OK
/webkit2/WebKitPrintOperation/print: OK
/webkit2/WebKitPrintOperation/print-errors: 
(lt-WebKitWebProcess:19919): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel-&gt;is_writeable&apos; failed

(lt-WebKitWebProcess:19919): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel-&gt;is_writeable&apos; failed

(lt-WebKitWebProcess:19919): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel-&gt;is_writeable&apos; failed

(lt-WebKitWebProcess:19919): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel-&gt;is_writeable&apos; failed
.....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>732972</commentid>
    <comment_count>6</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2012-10-02 12:50:51 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; This patch broke unit tests, see
&gt;
&gt; /webkit2/WebKitPrintOperation/printing-settings: OK
&gt; /webkit2/WebKitWebView/print: OK
&gt; /webkit2/WebKitPrintOperation/print: OK
&gt; /webkit2/WebKitPrintOperation/print-errors:
&gt; (lt-WebKitWebProcess:19919): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel-&gt;is_writeable&apos; failed

The difference now is that the destructor of the derived class is also
called, and that means in particular that
WebPrintOperationGtkUnix::m_printJob is now being destroyed, which is
probably the source of that critical.

I&apos;ll investigate what happens.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>733074</commentid>
    <comment_count>7</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2012-10-02 14:24:16 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; &gt; (lt-WebKitWebProcess:19919): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel-&gt;is_writeable&apos; failed

So this is triggered by the &quot;print-errors&quot; test, in particular the
last one (the one expecting WEBKIT_PRINT_ERROR_INVALID_PAGE_RANGE).

The test runs fine and it returns the expected value, but somehow
produces that critical message when the program exists.

My bet is that there&apos;s a bug somewhere in GtkPrintJob, which is the
object that gets destroyed now that the destructor is virtual.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>166429</attachid>
            <date>2012-10-01 02:05:31 -0700</date>
            <delta_ts>2012-10-01 04:12:01 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>virtual.diff</filename>
            <type>text/plain</type>
            <size>1507</size>
            <attacher name="Alberto Garcia">berto</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQyL0No
YW5nZUxvZwppbmRleCA3ZGY2MjY4Li44MThkMDVjIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViS2l0
Mi9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYktpdDIvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTcg
QEAKKzIwMTItMTAtMDEgIEFsYmVydG8gR2FyY2lhICA8YWdhcmNpYUBpZ2FsaWEuY29tPgorCisg
ICAgICAgIFdlYlByaW50T3BlcmF0aW9uR3RrIGRlc3RydWN0b3Igc2hvdWxkIGJlIHZpcnR1YWwK
KyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTk4MDAyCisK
KyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgV2ViUHJpbnRP
cGVyYXRpb25HdGsgaXMgYW4gYWJzdHJhY3QgY2xhc3Mgd2hpY2ggY2FuIGJlIGRlbGV0ZWQKKyAg
ICAgICAgdXNpbmcgYSBwb2ludGVyIHRvIGl0c2VsZiwgeWV0IGl0cyBkZXN0cnVjdG9yIGlzIG5v
dCB2aXJ0dWFsLgorICAgICAgICBGaXhlcyAtV2RlbGV0ZS1ub24tdmlydHVhbC1kdG9yLgorCisg
ICAgICAgICogV2ViUHJvY2Vzcy9XZWJQYWdlL2d0ay9XZWJQcmludE9wZXJhdGlvbkd0ay5oOgor
ICAgICAgICAoV2ViUHJpbnRPcGVyYXRpb25HdGspOgorCiAyMDEyLTA5LTMwICBNYXJpbyBTYW5j
aGV6IFByYWRhICA8bXNhb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