Subject: FvwmForm core dump on colorset change

From: Dan Espen <[email-masked]>
Date: Sun, 06 Apr 2003 14:13:39 -0400

There appears to be a bug in repainting the label of a choice
when a colorset changes.

I have FvwmForm configured to use a colorset for text.

If I change a color in the colorset while the FvwmForm default display
is being displayed, the default form core dumps.

I've been trying to figure out whats going on, but I haven't made
any progress.

Here is the stack:

(gdb) where
#0  0x400ec014 in XSetFont () from /usr/X11R6/lib/libX11.so.6
#1  0x4015b708 in _Xutf8GenericDrawImageString ()
   from /usr/X11R6/lib/libX11.so.6
#2  0x4015bb97 in _XmbGenericDrawString () from /usr/X11R6/lib/libX11.so.6
#3  0x4010e53b in XmbDrawString () from /usr/X11R6/lib/libX11.so.6
#4  0x080540c6 in FlocaleDrawString (dpy=0x807be20, flf=0x808dac8, 
    fws=0x808da58, flags=1) at ../../fvwm2_5_7/libs/Flocale.c:1411
#5  0x0804e49b in RedrawFrame (pev=0x0)
    at ../../../fvwm2_5_7/modules/FvwmForm/FvwmForm.c:1549
#6  0x08050194 in ParseActiveMessage (
    buf=0x8073b5c "Colorset 0 0 bdf7 1f f800 8c71 0 0 0 0 64 0 0 0 0 0 0 0 0 0 64") at ../../../fvwm2_5_7/modules/FvwmForm/FvwmForm.c:2402
#7  0x0804fed3 in ReadFvwm ()
    at ../../../fvwm2_5_7/modules/FvwmForm/FvwmForm.c:2293
#8  0x0805048b in MainLoop ()
    at ../../../fvwm2_5_7/modules/FvwmForm/FvwmForm.c:2499
#9  0x08050912 in main (argc=7, argv=0xbffff8b4)
    at ../../../fvwm2_5_7/modules/FvwmForm/FvwmForm.c:2699
#10 0x401ea5b0 in __libc_start_main () from /lib/libc.so.6

Here is the pointer "flf":

(gdb) up 4
#4  0x080540c6 in FlocaleDrawString (dpy=0x807be20, flf=0x808dac8, 
    fws=0x808da58, flags=1) at ../../fvwm2_5_7/libs/Flocale.c:1411
1411                    XmbDrawString(
(gdb) print flf
$1 = (FlocaleFont *) 0x807be20

Notice that the value for "flf" is really the value for "dpy".
The other args print OK.

I'm not sure whats going on.

-- 
Dan Espen                               E-mail: [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: Olivier Chapuis <[email-masked]>
Date: Thu, 10 Apr 2003 10:30:15 +0200

> I'm not sure whats going on.

I cannot reproduce this (can you send your .FvwmForm file?).
What about adding a 

	CheckAlloc(item,dt_ptr);

at line 1532 of FvwmForm.c (just after case I_CHOICE:)?
Just an idea which has not been thought!

Regards, Olivier

---

From: Dan Espen <[email-masked]>
Date: Thu, 10 Apr 2003 10:55:20 -0400

> > is being displayed, the default form core dumps.
...
> I cannot reproduce this (can you send your .FvwmForm file?).

I'm using FvwmForm-Talk and FvwmForm-Form both as packaged with Fvwm.

On the FvwmForm-Form I have "Color of text" "colorset" set to 0.
If I then go to FvwmForm-Talk and do:

Colorset 0 fg blue

(Providing the color is not already blue)
The default form dies.

---

From: Olivier Chapuis <[email-masked]>
Date: Sat, 19 Apr 2003 22:34:40 +0200

> I'm not sure whats going on.

I do not know too. I cannot reproduce your core dump, but I can
reproduce others which leads to similar strange Flocale gdb output.
There is surely a memory bug in Flocale (maybe in the charset
stuff).

Can you run purify on this if this make sense? If not I will try
to run others memory debugging tools.

Regards, Olivier

---

From: Dan Espen <[email-masked]>
Date: Tue, 22 Apr 2003 15:26:13 -0400

...
> to run others memory debugging tools.

I ran a Purify, nothing showed up.

---

From: Olivier Chapuis <[email-masked]>
Date: Fri, 25 Apr 2003 09:15:49 +0200

> > There is surely a memory bug in Flocale (maybe in the charset

I do not found any memory bug in Flocale but there were bugs with
icon fonts and EWMH icon name (sometimes the icon font was unloaded
but used by ewmh_names ...).
  
Any way, I've tried to fix the FvwmForm core dump you report.
Can you try to reproduce it again?

Regards, Olivier

---

From: Dan Espen <[email-masked]>
Date: Fri, 25 Apr 2003 08:01:48 -0400

> Can you try to reproduce it again?

It works now.

If I understand what you fixed,
it looks to me like that same logic was OK back in 2.4.x.

That must have been hard to find.  The symptom didn't give
many clues.

Thanks.