XFWM4 crashes when the application tries to create a window with too thick border.
The attached program demonstrates this bug.
It happens when the application creates a window with very big number in border_width
argument of XCreateWindow() or xcb_create_window().
The demo application gets one number as an argument and creates window with this number as a border_width
. On my machine, xfwm4 starts to hangs a little on values of 10000 and crashes with values above 20000. (The maximal value for this argument is 65535 (uint16_t).
The X server continues to work. The demo application continues to work as well. It needs to be terminated (from console session) in order to restart the window manager.
It looks like the window manager tries to allocate something (memory?) proportional to the width of the border (or O(w^2) or even more). So, when the border is thick enough, the allocation fails and the window manager crashes.
The crash happens after the xcb_create_window()/xcb_flush(), even if the window is never mapped with xcb_map_window() function.
The really strange for me is that the border_width
argument is actually ignored. Even on small enough widths, when the window manager does not crash and everything works fine, the border of the window is not as thick as the argument passed.