<html>
    <head>
      <base href="https://bugzilla.gnome.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 - wayland: Switching between fullscreen and unfullscreen using F11 in google-chrome causes gnome-shell to hang"
   href="https://bugzilla.gnome.org/show_bug.cgi?id=762618">762618</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>wayland: Switching between fullscreen and unfullscreen using F11 in google-chrome causes gnome-shell to hang
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Core
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>mutter
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.19.x
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>wayland
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mutter-maint@gnome.bugs
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ofourdan@redhat.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mutter-maint@gnome.bugs
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jadahl@gmail.com, mclasen@redhat.com, rob@robster.org.uk, wayland-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>GNOME version</th>
          <td>---
          </td>
        </tr></table>
      <p>
        <div>
        <pre>+++ This bug was initially created as a clone of <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - wayland: Switching between fullscreen and unfullscreen too fast may result in a fullscreen->unfullscreen feedback loop"
   href="show_bug.cgi?id=762468">Bug #762468</a> +++

Description

Using F11 to toggle google-chrome fullscreen and back in Wayland cause
gnome-shell to hang, calling the fullscreen animations continuously.

Steps to reproduce

1. Open google-chrome
2. Press F11 to switch to fullscreen
3. Press F11 to switch back to normal

Actual result

gnome-shell becomes unresponsive and takes a lot of CPU

Expected result

google-chrome switches back to normal and gnome-shell remains usable

Additional data

Atatching gdb to the gnome-shell process shows it's taking a lot of CPU in
mesa.

Thread 1 "gnome-shell" received signal SIGINT, Interrupt.
0x00007fb44b8a620e in convert_ubyte (void_dst=<optimized out>,
num_dst_channels=<optimized out>, void_src=<optimized out>, src_type=<optimized
out>, 
    num_src_channels=<optimized out>, swizzle=<optimized out>, normalized=true,
count=1024) at main/format_utils.c:1005
1005          SWIZZLE_CONVERT(uint8_t, uint8_t, src);
(gdb) bt
</pre>
<p class="trace_link" title="See Full Trace">
  <a class="trace_toggle_box" href="#"
     title="Expand/Collapse Trace"
     onclick="traceparser_toggle_trace(this, 235995); return false;">+</a>
  <a href="page.cgi?id=traceparser/trace.html&trace_id=235995">Trace
    235995</a></p>

<table border="0" cellpadding="0" cellspacing="0"><tr><td>
<div class="trace  bz_default_hidden"
     id="trace_235995">


      <ul class="frames">
          <li class="frame ">
              <span class="frame_number">#0</span>
            <span class="frame_function">convert_ubyte</span>
              <div class="frame_file_container">
                at <span class="frame_file">main/format_utils.c</span>
                  line
                  <span class="frame_line">1005</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#1</span>
            <span class="frame_function">_mesa_format_convert</span>
              <div class="frame_file_container">
                at <span class="frame_file">main/format_utils.c</span>
                  line
                  <span class="frame_line">354</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#2</span>
            <span class="frame_function">_mesa_GetTexSubImage_sw</span>
              <div class="frame_file_container">
                at <span class="frame_file">main/texgetimage.c</span>
                  line
                  <span class="frame_line">544</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#3</span>
            <span class="frame_function">_mesa_GetTexSubImage_sw</span>
              <div class="frame_file_container">
                at <span class="frame_file">main/texgetimage.c</span>
                  line
                  <span class="frame_line">601</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#4</span>
            <span class="frame_function">_mesa_GetTexSubImage_sw</span>
              <div class="frame_file_container">
                at <span class="frame_file">main/texgetimage.c</span>
                  line
                  <span class="frame_line">758</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#5</span>
            <span class="frame_function">_mesa_meta_GetTexSubImage</span>
              <div class="frame_file_container">
                at <span class="frame_file">drivers/common/meta.c</span>
                  line
                  <span class="frame_line">3284</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#6</span>
            <span class="frame_function">intel_get_tex_sub_image</span>
              <div class="frame_file_container">
                at <span class="frame_file">intel_tex_image.c</span>
                  line
                  <span class="frame_line">508</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#7</span>
            <span class="frame_function">get_texture_image</span>
              <div class="frame_file_container">
                at <span class="frame_file">main/texgetimage.c</span>
                  line
                  <span class="frame_line">1337</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#8</span>
            <span class="frame_function">_mesa_GetTexImage</span>
              <div class="frame_file_container">
                at <span class="frame_file">main/texgetimage.c</span>
                  line
                  <span class="frame_line">1405</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#9</span>
            <span class="frame_function">_cogl_texture_driver_gl_get_tex_image</span>
              <div class="frame_file_container">
                at <span class="frame_file">driver/gl/gl/cogl-texture-driver-gl.c</span>
                  line
                  <span class="frame_line">426</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#10</span>
            <span class="frame_function">_cogl_texture_2d_gl_get_data</span>
              <div class="frame_file_container">
                at <span class="frame_file">driver/gl/cogl-texture-2d-gl.c</span>
                  line
                  <span class="frame_line">751</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#11</span>
            <span class="frame_function">_cogl_texture_2d_get_data</span>
              <div class="frame_file_container">
                at <span class="frame_file">cogl-texture-2d.c</span>
                  line
                  <span class="frame_line">641</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#12</span>
            <span class="frame_function">texture_get_cb</span>
              <div class="frame_file_container">
                at <span class="frame_file">cogl-texture.c</span>
                  line
                  <span class="frame_line">989</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#13</span>
            <span class="frame_function">normalize_meta_coords_cb</span>
              <div class="frame_file_container">
                at <span class="frame_file">cogl-meta-texture.c</span>
                  line
                  <span class="frame_line">466</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#14</span>
            <span class="frame_function">padded_grid_repeat_cb</span>
              <div class="frame_file_container">
                at <span class="frame_file">cogl-meta-texture.c</span>
                  line
                  <span class="frame_line">96</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#15</span>
            <span class="frame_function">_cogl_texture_spans_foreach_in_region</span>
              <div class="frame_file_container">
                at <span class="frame_file">cogl-texture.c</span>
                  line
                  <span class="frame_line">1360</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#16</span>
            <span class="frame_function">create_grid_and_repeat_cb</span>
              <div class="frame_file_container">
                at <span class="frame_file">cogl-meta-texture.c</span>
                  line
                  <span class="frame_line">209</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#17</span>
            <span class="frame_function">_cogl_sub_texture_foreach_sub_texture_in_region</span>
              <div class="frame_file_container">
                at <span class="frame_file">cogl-sub-texture.c</span>
                  line
                  <span class="frame_line">173</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#18</span>
            <span class="frame_function">cogl_meta_texture_foreach_in_region</span>
              <div class="frame_file_container">
                at <span class="frame_file">cogl-meta-texture.c</span>
                  line
                  <span class="frame_line">604</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#19</span>
            <span class="frame_function">cogl_texture_get_data</span>
              <div class="frame_file_container">
                at <span class="frame_file">cogl-texture.c</span>
                  line
                  <span class="frame_line">1142</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#20</span>
            <span class="frame_function">meta_shaped_texture_get_image</span>
              <div class="frame_file_container">
                at <span class="frame_file">compositor/meta-shaped-texture.c</span>
                  line
                  <span class="frame_line">843</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#21</span>
            <span class="frame_function">shell_util_get_content_for_window_actor</span>
              <div class="frame_file_container">
                at <span class="frame_file">shell-util.c</span>
                  line
                  <span class="frame_line">448</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#22</span>
            <span class="frame_function">ffi_call_unix64</span>
              <div class="frame_file_container">
                at <span class="frame_file">../src/x86/unix64.S</span>
                  line
                  <span class="frame_line">76</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#23</span>
            <span class="frame_function">ffi_call</span>
              <div class="frame_file_container">
                at <span class="frame_file">../src/x86/ffi64.c</span>
                  line
                  <span class="frame_line">525</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#24</span>
            <span class="frame_function">gjs_invoke_c_function(JSContext*, Function*, JSObject*, unsigned int, jsval*, jsval*, GArgument*)</span>
              <div class="frame_file_container">
                at <span class="frame_file">gi/function.cpp</span>
                  line
                  <span class="frame_line">999</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#25</span>
            <span class="frame_function">function_call(JSContext*, unsigned int, jsval*)</span>
              <div class="frame_file_container">
                at <span class="frame_file">gi/function.cpp</span>
                  line
                  <span class="frame_line">1322</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#26</span>
            <span class="frame_function">js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct)</span>
              <div class="frame_file_container">
                at <span class="frame_file">/usr/src/debug/mozjs-24.2.0/js/src/jscntxtinlines.h</span>
                  line
                  <span class="frame_line">321</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#27</span>
            <span class="frame_function">js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct)</span>
              <div class="frame_file_container">
                at <span class="frame_file">/usr/src/debug/mozjs-24.2.0/js/src/vm/Interpreter.cpp</span>
                  line
                  <span class="frame_line">474</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#28</span>
            <span class="frame_function">js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value*, JS::Value*)</span>
              <div class="frame_file_container">
                at <span class="frame_file">/usr/src/debug/mozjs-24.2.0/js/src/vm/Interpreter.cpp</span>
                  line
                  <span class="frame_line">531</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#29</span>
            <span class="frame_function">js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, uint32_t, JS::Value*, JS::MutableHandleValue)</span>
              <div class="frame_file_container">
                at <span class="frame_file">/usr/src/debug/mozjs-24.2.0/js/src/jit/BaselineIC.cpp</span>
                  line
                  <span class="frame_line">7007</span>
              </div>
          </li>
          <li class="frame ">
              <span class="frame_number">#30</span>
            <span class="frame_function">0x00007fb477ab1dfb in</span>
          </li>
          <li class="frame ">
              <span class="frame_number">#31</span>
            <span class="frame_function">0x0000000000000000 in</span>
          </li>
      </ul>
</div>
</td></tr></table>
<pre class="bz_comment_text" >

Thiss is because shell_util_get_content_for_window_actor() from
src/shell-util.c is being called continuously.

This leads us to Javascript code in _fullscreenAnimation() in
js/ui/windowManager.js 

Adding traces to _sizeChangeWindow() _fullscreenWindow() _unfullscreenWindow()
and _fullscreenAnimation() shows that sizeChangeWindow() is called continuously
leading to fullscreen/unfulscreen, thus triggering the fullscreenAnimation
continuously:

Feb 24 15:22:47 x61 org.gnome.Shell.desktop[4684]: _fullscreenAnimation:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:47 x61 org.gnome.Shell.desktop[4684]: _unfullscreenWindow:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:47 x61 org.gnome.Shell.desktop[4684]: _sizeChangeWindow: 3
Feb 24 15:22:47 x61 org.gnome.Shell.desktop[4684]: _fullscreenAnimation:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:47 x61 org.gnome.Shell.desktop[4684]: _fullscreenWindow:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:47 x61 org.gnome.Shell.desktop[4684]: _sizeChangeWindow: 2
Feb 24 15:22:47 x61 org.gnome.Shell.desktop[4684]: _fullscreenAnimation:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:47 x61 org.gnome.Shell.desktop[4684]: _unfullscreenWindow:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:47 x61 org.gnome.Shell.desktop[4684]: _sizeChangeWindow: 3
Feb 24 15:22:47 x61 org.gnome.Shell.desktop[4684]: _fullscreenAnimation:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:47 x61 org.gnome.Shell.desktop[4684]: _fullscreenWindow:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:47 x61 org.gnome.Shell.desktop[4684]: _sizeChangeWindow: 2
Feb 24 15:22:46 x61 org.gnome.Shell.desktop[4684]: _fullscreenAnimation:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:46 x61 org.gnome.Shell.desktop[4684]: _unfullscreenWindow:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:46 x61 org.gnome.Shell.desktop[4684]: _sizeChangeWindow: 3
Feb 24 15:22:46 x61 org.gnome.Shell.desktop[4684]: _fullscreenAnimation:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:46 x61 org.gnome.Shell.desktop[4684]: _fullscreenWindow:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:46 x61 org.gnome.Shell.desktop[4684]: _sizeChangeWindow: 2
Feb 24 15:22:46 x61 org.gnome.Shell.desktop[4684]: _fullscreenAnimation:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:46 x61 org.gnome.Shell.desktop[4684]: _unfullscreenWindow:
[0x564885a00bd0 MetaWindowActor]
Feb 24 15:22:46 x61 org.gnome.Shell.desktop[4684]: _sizeChangeWindow: 3

But this doesn;t seem to be coming from an actual state change because breaking
on xdg_surface_set_fullscreen()/xdg_surface_unset_fullscreen() in gdb shows
these are not triggered while the Javascript routines are called continuously.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>