stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] [PATCH] Stop StumpWM from crashing while checking window hints


From: Diogo F. S. Ramos
Subject: [STUMP] [PATCH] Stop StumpWM from crashing while checking window hints
Date: Sat, 27 Dec 2014 18:34:04 -0200

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]