Subject: bug#69478: 30.0.50; Emacs dies after scrolling in eww

From: Po Lu <[email-masked]>
Date: Fri, 01 Mar 2024 09:48:49 +0800

Eli Zaretskii <[email-masked]> writes:

>> #27 0x0000555555689dfe in x_error_quitter (display=0x555556262960, event=0x7fffffffcc60) at xterm.c:26978
>>         buf = "BadMatch (invalid parameter attributes)", '\000' <repeats 216 times>
>>         buf1 = "X protocol error: BadMatch (invalid parameter attributes) on protocol request 62\nSerial no: 24290\nFailing resource ID (if any): 0x12001dc\nMinor code: 0\nThis is a bug!  Please report this to bug-gnu-em"...
>> #28 0x0000555555689feb in x_error_handler (display=0x555556262960, event=0x7fffffffcc60) at xterm.c:26943
>>         stack = <optimized out>
>>         dpyinfo = <optimized out>
>>         fail = <optimized out>
>>         last = <optimized out>
>> #29 0x00007ffff7cac74c in _XError (dpy=dpy@entry=0x555556262960, rep=rep@entry=0x55556106b3f0) at /usr/src/debug/libx11/libX11-1.8.7/src/XlibInt.c:1503
> [...]
>> #30 0x00007ffff7cac858 in handle_error (dpy=0x555556262960, err=0x55556106b3f0, in_XReply=<optimized out>) at /usr/src/debug/libx11/libX11-1.8.7/src/xcb_io.c:211
>>         ext = <optimized out>
>>         ret_code = 21845
>> #31 0x00007ffff7cac915 in handle_response (dpy=dpy@entry=0x555556262960, response=0x55556106b3f0, in_XReply=in_XReply@entry=0) at /usr/src/debug/libx11/libX11-1.8.7/src/xcb_io.c:403
>>         async = <optimized out>
>>         next = <optimized out>
>> #32 0x00007ffff7cac9aa in _XEventsQueued (dpy=0x555556262960, mode=<optimized out>) at /usr/src/debug/libx11/libX11-1.8.7/src/xcb_io.c:442
>>         response = <optimized out>
>> #33 0x00007ffff7c9f2c8 in XPending (dpy=0x555556262960) at /usr/src/debug/libx11/libX11-1.8.7/src/Pending.c:55
>>         ret_val = <optimized out>
>> #34 0x000055555569e933 in XTread_socket (terminal=<optimized out>, hold_quit=0x7fffffffcf00) at xterm.c:25576
>>         count = 0
>>         event_found = <optimized out>
>>         dpyinfo = 0x555556274760
>> #35 0x00005555556cac31 in gobble_input () at keyboard.c:7888
>>         nr = <optimized out>
>>         hold_quit = {kind = NO_EVENT, part = scroll_bar_nowhere, code = 0, modifiers = 0, x = 0x0, y = 0x0, timestamp = 0, frame_or_window = 0x0, arg = 0x0, device = 0x30}
>>         next = 0x0
>>         nread = 0
>>         err = <optimized out>
>>         t = 0x555556190378
>> #36 0x00005555556cd4a5 in handle_async_input () at keyboard.c:8127
>>         nread = <optimized out>
>> #37 process_pending_signals () at keyboard.c:8141
>> #38 unblock_input_to (level=0) at keyboard.c:8156
>> #39 unblock_input_to (level=<optimized out>) at keyboard.c:8150
>> #40 unblock_input () at keyboard.c:8175
>
> seems to indicate that the reason for the problem is some kind of X
> error, which then causes Emacs to shut down.
>
> Po Lu, any ideas what this could mean?

This is a BadMatch error triggered by copying between incompatible
drawables with a CopyArea request, which isn't possible in most of our
callers.  The crash's circumstances suggest that an image is being
created and subsequently copied with incompatible parameters, but to
establish which image that is Emacs must be started as follows:

  ./emacs -xrm 'Emacs.synchronous: true'

so that X errors are reported immediately upon the offending requests
being issued.