Subject: FvwmTheme problem tracked down

From: Brad Giaccio <[email-masked]>
Date: Wed, 27 Jun 2001 06:49:47 -0400

Well I finally tracked down the problem with Fvwm Theme it was dumping
core on
*FvwmTheme: Colorset 3 fg #d7dde8, bg #43608e, CGradient 128 #979797 #596eb1
while creating the gradient.

Which brings me to you Dan:
2001-05-14  Dan Espen  <[email-masked]>

    * libs/Graphics.c (CreateGradientPixmap): Avoid divide by zero errors
    in S,C,Y Gradients with the help of a very smart horse.

for it is here that it is crashing.  Reverting the section for CGRADIENT
back to the way it was fixes my problem but may break whatever the change
was intended to fix.

If you could give me some insight here it would be appreciated.

Brad

-- 
--- 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: Dominik Vogt <[email-masked]>
Date: Wed, 27 Jun 2001 13:18:27 +0200

> If you could give me some insight here it would be appreciated.

It crashes for me in this line:

  register double x = (double)((2 * i - t_width) * t_height) / 4.0;

with i = 0 and t_width = 255.  The problem is that i is an int
while t_width is an unsigned int.  The subtraction results in a
very large number.  This is used later to calculate an invalid
array index which causes the crash.

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, email: [email-masked]
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
--
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, 27 Jun 2001 07:33:21 -0400

> array index which causes the crash.

Well that makes sense.  I tried your fix and all is well for me now.
Thanks gdb wasn't letting me look at register values for some reason
so it was taking me a little longer to track down the problem.

Thanks,
Brad

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 27 Jun 2001 13:57:38 +0200

> so it was taking me a little longer to track down the problem.

I really hate that about C.  Everything looks fine, but it does
ridiculous type confersions without complaining.  That's why I
usually cast each and every variable in calculations nowadays.

Bye

Dominik ^_^  ^_^