Subject: core dump with Style * $[fg.cs0]/$[bg.cs0]

From: Brad Giaccio <[email-masked]>
Date: Tue, 5 Oct 1999 14:16:52 -0400

regardless of the colorset I seem to dump core with the error being printed 
Arithmetic error - dumping core 

here is the stack 
#0  0xff0b6d54 in .udiv () from /usr/lib/libc.so.1
#1  0xff24ba24 in XcmsLRGB_RGB_ParseString () from /usr/local/X11R6/lib/libX11.so.6.0
#2  0xff2488e0 in _XcmsParseColorString () from /usr/local/X11R6/lib/libX11.so.6.0
#3  0xff2492fc in _XcmsResolveColorString () from /usr/local/X11R6/lib/libX11.so.6.0
#4  0xff227a8c in XParseColor () from /usr/local/X11R6/lib/libX11.so.6.0
#5  0x521d8 in GetSimpleColor (name=0xc5f18 "rgb:cccc") at Picture.c:497
#6  0x523d0 in GetColor (name=0xc5f18 "rgb:cccc") at Picture.c:550
#7  0x3b574 in AddWindow (w=197132311, ReuseWin=0x7cc60) at add_window.c:490
#8  0x2bf54 in HandleMapRequestKeepRaised (KeepRaised=0, ReuseWin=0x7cc60) at events.c:991
#9  0x2ef9c in CaptureOneWindow (fw=0x7cc60, window=511072) at fvwm.c:831
#10 0x2f1a8 in CaptureAllWindows () at fvwm.c:902
#11 0x2a118 in do_recapture (eventp=0x0, w=55, tmp_win=0x0, context=8, action=0xcb432 "", 
    Module=0xffbeeab4, fSingle=453632) at builtins.c:2437
#12 0x2a180 in Recapture (eventp=0x6eb40, w=55, tmp_win=0x0, context=8, 
    action=0xcb432 "", Module=0xffbeeab4) at builtins.c:2453
#13 0x44038 in ExecuteFunction (Action=0xcb428 "recapture\n", tmp_win=0x0, 
    eventp=0x6eb40, context=8, Module=7, expand_cmd=371660) at functions.c:799
#14 0x3f788 in HandleModuleInput (w=0, channel=7, expect=0x0) at module_interface.c:547
#15 0x2da14 in My_XNextEvent (dpy=0x1c, event=0x7) at events.c:2047
#16 0x2af30 in HandleEvents () at events.c:242
#17 0x2ecd8 in main (argc=449536, argv=0x6ec00) at fvwm.c:703

I'm guessing something is write with name being rgb:cccc
The colorset in question had fg gray80, bg #c05b23
FvwmCommand 'Echo $[fg.cs0] $[bg.cs0]'
[FVWM][Echo]:  rgb:cccc/cccc/cccc rgb:c0c0/5b5b/2323

Any idea why its gettig cut off?

-- 
--- There are two kinds of knowledge, you either know the answer or
			you know where to find it
		      -Kane, Johnson, and anonymous
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Brad Giaccio <[email-masked]>
Date: Wed, 6 Oct 1999 08:51:23 -0400

> Any idea why its gettig cut off?

Oops, sort of my mistake but we should probabbly handle this better
than dumping core.  I looked at the new examples in the man page for
FvwmThem.  And took the 2 lines

Style "*" ForeColor $[fg.cs0]
Style "*" BackColor $[bg.cs0]
and made them into
Style "*" $[fg.cs0]/$[bg.cs0]
which works fine when your colors are not in the form rgb:cccc/cccc/cccc

So this was my mistake but we probablly want to error on something like
this in the future.

Brad

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 7 Oct 1999 12:00:19 +0200

> Style "*" $[fg.cs0]/$[bg.cs0]
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

??? Do you mean 'HilightColor $[fg.cs0]/$[bg.cs0]'?  I can't believe
fvwm even tried to interpret the strings a colours on this 'Style'
line.

> #4  0xff227a8c in XParseColor () from /usr/local/X11R6/lib/libX11.so.6.0

Hm, your X lib has crashed in XParseColor.  I'm not sure what we can do about
it except reporting it to the X server vendor.  My XFree doesn't coredump here.
Can you check if you get the crash if you simply use 'Style * rgb:cccc'?

Bye

Dominik ^_^

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Brad Giaccio <[email-masked]>
Date: Thu, 7 Oct 1999 07:39:36 -0400

> > Style "*" $[fg.cs0]/$[bg.cs0]

what I actually ment to type was 
  Style "*" Color $[fg.cs0]/$[bg.cs0]
            ^^^^^
and from the man page 
    Color takes two arguments.  The first  is  the  window-
          label   text   color  and  the  second  is  the  window
          decoration's normal background color.  The  two  colors
          are  separated  with  a  slash.   If the use of a slash
          causes  problems  then  the  separate   ForeColor   and
          BackColor options can be used.

> Can you check if you get the crash if you simply use 'Style * rgb:cccc'?

I guess the only thing we could do is check that we are passing
something that looks like a valid color name to XParseColor rgb:cccc is
not but rgb:<4chars>/<4chars>/<4chars> is valid.

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 7 Oct 1999 14:56:22 +0200

> not but rgb:<4chars>/<4chars>/<4chars> is valid.

Gack!  There *must* be an easier way.

Bye

Dominik ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Sat, 16 Oct 1999 06:23:25 +0200

> not but rgb:<4chars>/<4chars>/<4chars> is valid.

We check for the proper number of slashes in GetSimpleColor() and
in ProcessNewStyle() now.  Thus the colour set spec in the style
line should work now plus it shouldn't coredump even if you say

  Style * forecolor rgb:ff/

Can you try this, Brad?

Bye

Dominik ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Brad Giaccio <[email-masked]>
Date: Wed, 20 Oct 1999 08:06:16 -0400

>   Style * forecolor rgb:ff/

Much better now with Style "*" $[fg.cs0]/$[bg.cs0]
I get 
[FVWM][ProcessNewStyle]: <<ERROR>> bad style command: \
rgb:4141/1f1f/0303/rgb:c0c0/5b5b/2323

Brad