[PATCH] Stop StumpWM from crashing while checking window hints

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[PATCH] Stop StumpWM from crashing while checking window hints

Diogo F. S. Ramos-2
A particular type of window makes StumpwWM crash because of xlib.

A crash can be reproduced by running `cvlc' (Console VLC) with any

The bug can be tracked to a `window-urgent-p' call, which calls
`xlib:wm-hints', which then calls `xlib::decode-wm-hints'.
`xlib::decode-wm-hints' signals a condition about a wrong type.

It is not clear to me where the real issue is, i.e, what is creating
the wrong type of vector.
 window.lisp |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/window.lisp b/window.lisp
index ec2c2bb..7137922 100644
--- a/window.lisp
+++ b/window.lisp
@@ -121,7 +121,14 @@ WINDOW"
 (defun window-urgent-p (window)
   "Returns T if WINDOW has the urgency bit and/or
-  (let* ((hints (xlib:wm-hints (window-xwin window)))
+  (let* ((xwin (window-xwin window))
+         (hints (handler-case
+                    ;; `XLIB::DECODE-WM-HINTS' can signal a condition
+                    ;; about a vector not being of type (SIMPLE-VECTOR
+                    ;; 9).  This can be triggered by an cvlc (Console
+                    ;; version of VLC) window, for example.
+                    (xlib:wm-hints xwin)
+                  (error nil)))
          (flags (when hints (xlib:wm-hints-flags hints))))
     ;; XXX: as of clisp 2.46 flags is a list, not a number.
     (or (and flags (if (listp flags)

Stumpwm-devel mailing list
[hidden email]