<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] Web Process crashes on reparenting a WebView with AC mode on"
   href="https://bugs.webkit.org/show_bug.cgi?id=151139">151139</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[GTK] Web Process crashes on reparenting a WebView with AC mode on
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>Gtk
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebKit Gtk
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mario&#64;webkit.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>agomez&#64;igalia.com, bugs-noreply&#64;webkitgtk.org, cgarcia&#64;igalia.com, mrobinson&#64;webkit.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=265293" name="attach_265293" title="Backtraces for the UI and Web processes (Release build)">attachment 265293</a> <a href="attachment.cgi?id=265293&amp;action=edit" title="Backtraces for the UI and Web processes (Release build)">[details]</a></span>
Backtraces for the UI and Web processes (Release build)

At least since WebKitGTK+ 2.10.0, the Web Process does very often die when the WebView gets reparented from one container to another (removing + adding, NOT using gtk_widget_reparent()) while using Accelerated Compositing, which seems to happen due to a X BadDrawable error, which eventually makes the UI process crash as well.

More specifically, the error that is being reported from the X.org server is like this:

  (WebKitWebProcess:8500): Gdk-ERROR **: The program 'WebKitWebProcess' received an X Window System error.
  This probably reflects a bug in the program.
  The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
    (Details: serial 690 error_code 9 request_code 152 (DRI2) minor_code 8)
    (Note to programmers: normally, X errors are reported asynchronously;
     that is, you will receive the error a while after causing it.
     To debug your program, run it with the GDK_SYNCHRONIZE environment
     variable to change this behavior. You can then get a meaningful
     backtrace from your debugger if you break on the gdk_x_error() function.)

Please see attached a dump of the two backtraces as they are generated by the UI and the Web processes. Those were taken with a release build of WebKit since that's the one I have around now, but I will try to reproduce it in a debug build asap as well, will attach it later.

This crash has happened in a 64-bit Fedora 22 machine with the latest code from WebKit's trunk compiled from sources, using the build-webkit script.


Additional details:

This issue was not happening at all in 2.6.2 and it's crashing from 2.10.0 as far as I can see, although in 2.8.x some graphics corruption is present already when reparenting already. Carlos explained to me on IRC that this is mostly to the move to using PlatformDisplay, which reuses GDK's connection to the X display and install a bunch of error handlers, which were not present before (thus the problem has probably been there for a while, and was simply ignored)

Anyway, just for the sake of completeness I'm also linking an screencast showing the issue from inside a 32-bit Debian-like chroot:

  <a href="https://drive.google.com/file/d/0B6Gdj3EoWfFLSjZzdHFuVFJERGM/view?usp=sharing">https://drive.google.com/file/d/0B6Gdj3EoWfFLSjZzdHFuVFJERGM/view?usp=sharing</a>

Next, I will attach two test cases I wrote which I can reproduce the bug reliably with</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>