Subject: Re: bug#66068: 30.0.50; xwidget-webkit-browse-url makes Emacs abort

From: Stephen Berman <[email-masked]>
Date: Sat, 09 Dec 2023 21:39:47 +0100

On Sat, 09 Dec 2023 16:12:03 +0100 Stephen Berman <[email-masked]> wrote:

> On Thu, 07 Dec 2023 11:28:00 +0100 Ramon Diaz-Uriarte <[email-masked]> wrote:
>
>> For what is worth, xwidget-webkit-browse-url does not make Emacs 30 (30.0.50)
>> or 29 (29.1.90) abort on my system (Debian) (I just built both a few minutes
>> ago after freshly checking the git repos).
>>
>> The webkitgtk packages I have are:
>>
>> libwebkit2gtk-4.0-37:amd64                                  2.42.2-1
>> libwebkit2gtk-4.0-dev:amd64                                 2.42.2-1
>> libwebkit2gtk-4.0-doc                                       2.42.2-1
>> libwebkit2gtk-4.1-0:amd64                                   2.42.2-1
>
> This prompted me to update my webkitgtk to 2.42.3, the latest stable
> release, then I rebuilt Emacs from the latest commit on master.  But
> invoking xwidget-webkit-browse-url stills makes Emacs crash for me.
>
>> In case it could matter, I am using XMonad as window manager. When
>> `M-x xwidget-webkit-browse-url` and I enter the URL at the prompt and press
>> enter, on the terminal from which I did `emacs -Q` I see
>>
>> -------------------
>> Overriding existing handler for signal 10. Set JSC_SIGNAL_FOR_GC if you want
>> WebKit to use a different signal
>> libEGL warning: failed to get driver name for fd -1
>>
>> libEGL warning: MESA-LOADER: failed to retrieve device information
>>
>> libEGL warning: failed to get driver name for fd -1
>> -------------------
>>
>> But everything seems to work normally.
>
> I get the signal 10 message, but I think that's been emitted for some
> time when invoking xwidget-webkit-browse-url and isn't related to the
> crash.  I don't get the libEGL warnings, but I do get the following,
> which I think I haven't seen previously and seems like it could be
> related to the crash (which is perhaps then different from what I
> reported in my OP of this bug):
>
> (emacs-master:10722): GLib-CRITICAL **: 15:46:25.356: Source ID 658 was not
> found when attempting to remove it
> X protocol error: GLXBadWindow on protocol request 151
> Serial no: 6143
> Failing resource ID (if any): 0x2e001fe
> Minor code: 32
> This is a bug!  Please report this to [email-masked]!

My memory was wrong: in fact, the same output appears at the end of the
GDB backtrace attached to my OP in this bug.  And I just ran the emacs I
built against the latest webkitgtk under gdb, and when I start it with
-Q (or -q), invoking xwidget-webkit-browse-url makes it crash, and the
backtrace appears to be essentially the same as the one in my OP (except
in some of the frames the output is now much less detailed; perhaps
because I'm now building emacs with native compilation?).  And just as I
reported in a previous followup, when I start my fresh build of emacs
with -q -xrm "emacs.synchronous: true" outside of gdb, I also get the
crash, but when I start it under gdb with the same command line
arguments, then invoking xwidget-webkit-browse-url works fine.  I have
no idea why there is this difference, and no one offered an explanation
for it the last time; maybe this time?

Steve Berman