Bug 396319 - KWin fails to accept large window icons leading to X11 errors and applications not starting
Summary: KWin fails to accept large window icons leading to X11 errors and application...
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: platform-x11-standalone (other bugs)
Version First Reported In: 5.12.5
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-08 19:31 UTC by Kai Wb.
Modified: 2018-07-09 14:58 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:
curan: X11+
curan: Gallium3D+
curan: Mesa+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Wb. 2018-07-08 19:31:46 UTC
I came across a commercial application which tries to set a really large application icon (2100×1500 pixels). This leads to an X11 error with KWin:
> X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
>  Major opcode of failed request:  146 ()
>  Minor opcode of failed request:  74
>  Serial number of failed request:  168
>  Current serial number in output stream:  168

With xtrace (and setting LIBGL_DRI3_DISABLE=true, without this xtrace was stuck before logging the error) I was able to dig out the following failing request:

> 003:<: Warning: buffer filled!
> 003:<: Warning: Waiting for rest of package (yet got 65524 of 17640036)!
>003:<: Warning: buffer filled!
>003:<:009d:17640036: Request(18): ChangeProperty mode=Replace(0x00) >window=0x07400005 property=0x152("_NET_WM_ICON") type=0x6("CARDINAL") data=0x00000834,0x00000834,0x00000000,0x0000000,[...]

Manually scaling the window icon file down, let me start the application.

Now, according to https://specifications.freedesktop.org/wm-spec/latest/ar01s05.html#idm139870829941264 it is the window managers job to scale the image down and that no maximum size is mandated by the spec for _NET_WM_ICON. This seems to indicate to me, that an application is actually free to set such a ridiculously large icon and the window manager should just scale it down.

[NB: I can trigger this bug also with the Windows version of the application, if I run it through Wine. This seems to indicate, that Wine isn't scaling the image down either and also expects the window manager to deal with it.]

Let me know if you need anything else.
Comment 1 Martin Flöser 2018-07-09 04:16:32 UTC
Is xprop able to retrieve the icon
Comment 2 Kai Wb. 2018-07-09 07:40:29 UTC
(In reply to Martin Flöser from comment #1)
> Is xprop able to retrieve the icon

I think I'm not following you: wouldn't I need a running application/window for xprop to work? With the shipped (large) icon file the application is not starting. I can just see the window border for a split second and then the application dies with that X error. Or do you mean "can xprop retrieve the manually scaled down icon"?
Comment 3 Martin Flöser 2018-07-09 14:58:08 UTC
Oh it's the application giving this error? That changes everything: the window manager cannot trigger this issue. This is an application bug.