Subject: core dump in free_style

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 21 Oct 2000 15:32:34 +0200

Here is how to reproduce this core dump.

Create a ~/.fvwm/test-styles file with the following content:

Style "*"           BorderWidth 5
Style "Fvwm*"       Title, Sticky
Style "*"           IconBox 10 6 -400 -100
Style "FvwmIconMan" NoTitle, Sticky, BorderWidth 0
DestroyStyle "FvwmIconMan"

Start fvwm without rc file (optionally), open FvwmConsole and execute
'Read test-styles' several times.

With no additional configuration, fvwm should crash on the third Read,
with some existing configuration, it may take some more Read's.

GNU gdb 5.0
Core was generated by `fvwm2 -f without-rc'.
Program terminated with signal 11, Segmentation fault.
#0  free_icon_boxes (ib=0x80aa470) at style.c:161
161         if (ib->use_count == 0)
(gdb) where
#0  free_icon_boxes (ib=0x80aa470) at style.c:161
#1  0x805ad4b in free_style (style=0x80aa6e8) at style.c:484
#2  0x805b0fc in remove_style_from_list (style=0x80aa6e8, do_free_style=1)
    at style.c:679
#3  0x805af91 in simplify_style_list () at style.c:571
#4  0x8064d76 in HandleEvents () at events.c:2429
#5  0x807ff13 in main (argc=3, argv=0xbffff504) at fvwm.c:732
#6  0x4016ae21 in __libc_start_main (main=0x807ec60 <main>, argc=3,
    ubp_av=0xbffff504, init=0x804b010 <_init>, fini=0x8089a9c <_fini>,
    rtld_fini=0x4000df94 <_dl_fini>, stack_end=0xbffff4fc)
    at ../sysdeps/generic/libc-start.c:111

Regards,
Mikhael.
--
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: Sun, 22 Oct 2000 17:28:03 +0200

> with some existing configuration, it may take some more Read's.

Fixed. The reason was that the icon_boxes member of the style
structure was not set to NULL after the styles were deleted.
Thus, already deleted icon box structures were accessed and
freed again in another pass of simplify_style_list().

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: Mikhael Goikhman <[email-masked]>
Date: Fri, 27 Oct 2000 14:36:37 +0200

> freed again in another pass of simplify_style_list().

The core dump is fixed. But Style IconBox is now broken. Seems like it is
often removed instead of be defined.
Here is how to reproduce it on startup. Create ~/.fvwm/test-iconbox:

  Style * IconBox 400 400 -100 -100
  Style XCalc StartIconic
  Exec xcalc
  Exec xcalc

Start fvwm as 'fvwm2 -f test-iconbox'. The default icon box is used
instead of the defined one. The 'Read test-styles' fixes this, but if you
play with Style "*" something, Style "*" IconBox, it is incorrect again.

Regards,
Mikhael.