[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
video.

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
 _NET_WM_STATE_DEMANDS_ATTENTION set"
-  (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)
--
1.7.10.4


_______________________________________________
Stumpwm-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel