<?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>289081</bug_id>
          
          <creation_ts>2025-03-04 05:58:51 -0800</creation_ts>
          <short_desc>REGRESSION(2.42): GNU Emacs with gtk and xwidgets crashes with X protocol error: GLXBadWindow on protocol request</short_desc>
          <delta_ts>2025-03-05 04:46:22 -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>Other</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>1</everconfirmed>
          <reporter>bitstreamout</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>2100242</commentid>
    <comment_count>0</comment_count>
    <who name="">bitstreamout</who>
    <bug_when>2025-03-04 05:58:51 -0800</bug_when>
    <thetext>Just tested what described in emacs-30.1/etc/PROBLEMS  with emacs 29.4 (gtk port linked with libwebkit2gtk-4_1-0-2.46.4-2.1.x86_64) and indeed it crashes.

From macs-30.1/etc/PROBLEMS  

```
** Emacs built with xwidgets aborts when displaying WebKit xwidgets

This happens, for example, when &apos;M-x xwidget-webkit-browse-url&apos;
prompts for a URL and you type the URL at the prompt.

The error message might look like this:

  X protocol error: GLXBadWindow on protocol request 151
  Serial no: 4286
  Failing resource ID (if any): 0x3c001c5
  Minor code: 32

This happens because starting from version 2.42.1, the WebKitGTK
developers discontinued support for off-screen windows, by presuming
that every window holding a WebView widget is an X server window
eligible for an OpenGL context.  Emacs requires placing these widgets
within offscreen windows managed by GTK, for each xwidget might be
displayed in multiple distinct windows, and its contents must be
captured and reproduced within all of them if that be the case.

To put this another way, WebKitGTK doesn&apos;t support displaying a single
widget more than once anymore.

A possible workaround is to make sure xwidgets are not shown in more
than one window.
```

just wonder if this had ever been reported ... beside this I&apos;m not an GNU Emacs developer only a package maintainer for GNU emacs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100243</commentid>
    <comment_count>1</comment_count>
    <who name="">bitstreamout</who>
    <bug_when>2025-03-04 05:59:33 -0800</bug_when>
    <thetext>https://bugzilla.opensuse.org/show_bug.cgi?id=1237518</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100322</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2025-03-04 10:55:14 -0800</bug_when>
    <thetext>I think the next step here is to identify the change that introduced the regression. The title of your bug report says 2.41.92 is the first bad version, but your comment says 2.42.1. Which is it? Let&apos;s narrow this down as precisely as possible. Please test at least 2.41.91 and 2.42.0 to figure out for certain what is the last good version.

Would you or somebody else be willing to bisect to find the exact change that broke Emacs? That would help a lot.

&gt; just wonder if this had ever been reported ... beside this I&apos;m not an GNU Emacs developer only a package maintainer for GNU emacs

I did a quick search and failed to find any duplicate bug reports, so I assume you&apos;re the first person to report this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100534</commentid>
    <comment_count>3</comment_count>
    <who name="">bitstreamout</who>
    <bug_when>2025-03-04 23:17:57 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #2)
&gt; I think the next step here is to identify the change that introduced the
&gt; regression. The title of your bug report says 2.41.92 is the first bad
&gt; version, but your comment says 2.42.1. Which is it? Let&apos;s narrow this down
&gt; as precisely as possible. Please test at least 2.41.91 and 2.42.0 to figure
&gt; out for certain what is the last good version.
&gt; 
&gt; Would you or somebody else be willing to bisect to find the exact change
&gt; that broke Emacs? That would help a lot.
&gt; 
&gt; &gt; just wonder if this had ever been reported ... beside this I&apos;m not an GNU Emacs developer only a package maintainer for GNU emacs
&gt; 
&gt; I did a quick search and failed to find any duplicate bug reports, so I
&gt; assume you&apos;re the first person to report this.

This is what I can show from emacs-30.1/configure.ac

```
if test &quot;$with_xwidgets&quot; != &quot;no&quot;; then
  if test &quot;$USE_GTK_TOOLKIT&quot; = &quot;GTK3&quot; &amp;&amp; test &quot;$window_system&quot; != &quot;none&quot;; then
    WEBKIT_REQUIRED=2.12
    WEBKIT_BROKEN=2.41.92
    WEBKIT_MODULES=&quot;webkit2gtk-4.1 &gt;= $WEBKIT_REQUIRED webkit2gtk-4.1 &lt; $WEBKIT_BROKEN&quot;
    EMACS_CHECK_MODULES([WEBKIT], [$WEBKIT_MODULES])
    if test &quot;$HAVE_WEBKIT&quot; = &quot;no&quot;; then
      WEBKIT_MODULES=&quot;webkit2gtk-4.0 &gt;= $WEBKIT_REQUIRED webkit2gtk-4.0 &lt; $WEBKIT_BROKEN&quot;
      EMACS_CHECK_MODULES([WEBKIT], [$WEBKIT_MODULES])
    fi
[...]
```

and here is the discussion of the GNU Emacs developers

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66068

this also includes some backtraces and the tested versions of webkit2gtk</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2100581</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2025-03-05 04:45:30 -0800</bug_when>
    <thetext>It&apos;s not clear that anybody tested 2.41.91 though, so looks like the regression could be anywhere between 2.40 and 2.41.92.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>