<?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>238415</bug_id>
          
          <creation_ts>2022-03-26 07:12:18 -0700</creation_ts>
          <short_desc>[GTK4] Frequent UI process hangs</short_desc>
          <delta_ts>2022-11-18 11:01:19 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</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>
          
          <blocked>210100</blocked>
    
    <blocked>245783</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1855381</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-03-26 07:12:18 -0700</bug_when>
    <thetext>I&apos;m noticing frequent UI process hangs with GTK 4. (It&apos;s quite rare for this to occur with GTK 3.)

Getting a good backtrace is a little difficult because it&apos;s inside the flatpak environment, but host gdb was able to give me this:

#0  0x00007f77b505ae1d in __futex_abstimed_wait_common64 () from target:/usr/lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007f77b50545b4 in pthread_cond_wait () from target:/usr/lib/x86_64-linux-gnu/libpthread.so.0
#2  0x00007f77aec5d12b in wl_display_read_events () from target:/usr/lib/x86_64-linux-gnu/libwayland-client.so.0
#3  0x00007f77aec5db29 in wl_display_dispatch_queue () from target:/usr/lib/x86_64-linux-gnu/libwayland-client.so.0
#4  0x00007f77b5678e0f in gdk_wayland_toplevel_focus () from target:/usr/lib/x86_64-linux-gnu/libgtk-4.so.1
#5  0x00007f77b5ede7dd in ?? () from target:/app/lib/epiphany/libephymain.so
#6  0x00007f77b5c8ba19 in g_timeout_dispatch () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007f77b5c8aceb in g_main_context_dispatch () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007f77b5c8b1f8 in g_main_context_iterate.constprop () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007f77b5c8b2c4 in g_main_context_iteration () from target:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007f77b5b3404d in g_application_run () from target:/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#11 0x000055df12d970f6 in main ()

Probably that&apos;s not enough to fix this, but at least it&apos;s a hint. Looks like GTK 4 might be deadlocking when dispatching Wayland events. I wonder why.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911295</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-09 10:24:38 -0800</bug_when>
    <thetext>Note this is still happening quite regularly, and it&apos;s definitely a regression from the switch to GTK 4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1913442</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-18 07:26:41 -0800</bug_when>
    <thetext>Nowadays the hangs I see are almost always associated with web process hangs while a page is loading, which frequently happen when loading several pages at the same time. E.g. open cnn.com or arstechnica.com and middle click on a bunch of links to open several articles in new tabs. Almost always, one tab&apos;s load will stall and continue indefinitely. Attempting to close the out of control tab will then cause a UI process hang.

I&apos;m not confident these hangs correspond to the backtrace that I posted in comment #0, but I *am* confident it&apos;s the only UI process hang that I&apos;m encountering frequently right now. So if it&apos;s *not* the original issue here, then the original one doesn&apos;t matter anymore.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1913500</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-18 10:57:40 -0800</bug_when>
    <thetext>Hit it just now... the web process crashed due to bug #247628, which triggered an Epiphany crash that is an Epiphany bug. The UI process appears to hang for a while before the crash. Pretty sure it&apos;s not this issue, so I&apos;ll close this because it&apos;s not useful to keep open if it&apos;s no longer happening.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1913501</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-11-18 11:01:19 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #3)
&gt; Hit it just now... the web process crashed due to bug #247628, which
&gt; triggered an Epiphany crash that is an Epiphany bug.

https://gitlab.gnome.org/GNOME/epiphany/-/issues/1878</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>