Hi Kbamba,
Sorry for the delay looking into this; busy day^Wmon^Wyea^Wlife...
> When starting QMMP (I'm on FreeBSD), ctwm crashes in ewmh.c . It
> appears that vs->wsw->currentwspc isn't occupied as expected. The
> following patch fixes the crash.
So, I don't see any obvious way vs->wsw could be NULL. However,
->currentwspc could be, for the case where you have no WorkSpaces in
your config. That triggers it for me (only way I found in a little
fiddling), so I'm guessing that's your config. I'd guess that that's
a somewhat uncommon ctwm config, and QMMP is also relatively uncommon
in sending _NET_WM_DESKTOP messages, so hitting the bug takes the
(somewhat + relatively) intersection of those sets.
So I'd suggest the slightly simpler
--------------------------
=== modified file 'ewmh.c'
--- ewmh.c 2019-10-19 01:58:57 +0000
+++ ewmh.c 2020-02-15 23:03:49 +0000
@@ -1623,7 +1623,7 @@
occupation = twm_win->occupation;
/* Remove from visible workspace */
- if((vs = twm_win->vs) != NULL) {
+ if((vs = twm_win->vs) != NULL && vs->wsw->currentwspc != NULL) {
occupation &= ~(1 << vs->wsw->currentwspc->number);
}
--------------------------
variant. You could also work around it by just having a defined
workspace (or 10 :). I don't unsuspect that we have more similar bugs
hiding around the codebase assuming there are workspaces...
I wonder if we should change things to synthesize a single workspace
when none is given in the config. Might be some downstream
simplification that could add. We'll wait 'till next week to talk
about the simplification from killing the ->vs bit of the equation :p
--
Matthew Fuller (MF4839) | [email protected]
Systems/Network Administrator | http://www.over-yonder.net/~fullermd/
On the Internet, nobody can hear you scream.