On Sat, Dec 05, 2020 at 05:08:15PM +0100, Francesco Potort́ wrote: > >>> In this moment I have a *w3m* buffer on a live Emacs. If I switch to it > >>> on a text frame, everything is well. If I switch to it on an X display, > >>> the frame dies (but Emacs survives). The error is > >>> > >>> X protocol error: BadMatch (invalid parameter attributes) on protocol request 73 > > I managed to find the time to compile emacs with symbols. > > The previous instance of Emacs crashed, so apparently there is a serious > problem somewhere. > > On the plus side, now apparently every instance of a *w3m* buffer > exhibits the problem, which is now easy to reproduce for me. > > The error is: > redisplay: X protocol error: BadMatch (invalid parameter attributes) on protocol request 73 > which points to an XGetImage call where the pixmap or window to be > returned does not satisfy certain geometric criteria, according to > https://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html#requests:GetImage > > Setting debug-on-error to t tells me that this happens inside > redisplay_internal(). > > I evaluated (x-synchronize t) and then switched to the *w3b* buffer. > > Here is the backtrace. If you help me I can try and continue debugging. > #5 0x00007fc6655e033a in XGetImage () at /usr/lib/x86_64-linux-gnu/libX11.so.6 > #6 0x00005596a19c3788 in image_get_x_image (f=, img=img@entry=0x5596a57dccd0, mask_p=mask_p@entry=false) at ./debian/build-src/src/image.c:2934 > #7 0x00005596a19c938e in image_background (img=0x5596a57dccd0, f=, pimg=pimg@entry=0x0) at ./debian/build-src/src/image.c:1376 Hmm, my suspicion here is that we're calling XGetImage with dimensions that don't match the pixmap since we no longer store the dimensions of the original image. It hadn't occurred to me that we'd ever pull the image BACK from the X server. Can you try with the attached patch, please? -- Alan Third