Subject: fvwm 2.5.1[02] stucks sometimes, always wrt Mozilla windows

From: Parv <[email-masked]>
Date: Sat, 16 Oct 2004 01:27:56 -0400

Fvwm 2.5.1[02] gets stuck sometimes, always while raising or deiconifying a
Mozilla window via WindowList command.

When fvwm gets stuck...

  - CPU usage reaches near 100%
  - Mouse pointer remains in the set "CursorStyle MENU"
  - Mouse moves but clicks do not respond
  - Keyboard is also lost
  - No windows is raised/lowered or a page is changed

WindowListFunc & related functions and focus & placement related
styles are...

  DestroyFunc  EWMHActivateWindowFunc
  AddToFunc    EWMHActivateWindowFunc
  +  I WindowListFunc

  DestroyFunc  WindowListFunc
  AddToFunc    WindowListFunc
  +  I Function deiconify-func Raise
  +  I FlipFocus
  +  I WarpToWindow 50 50

  DestroyFunc  window-list
  AddToFunc    window-list
  +  I WindowList Root c c Sticky, OnTop, \
    NoGeometryWithInfo,  NoDeskNum,  NoNumInDeskTitle, \
    MaxLabelWidth 30, IconifiedAtEnd, $*

  DestroyFunc  window-list-sorted
  AddToFunc    window-list-sorted
  + I Function window-list  SortByResource

  DestroyFunc  deiconify-func
  AddToFunc    deiconify-func
  +  I Iconify false
  +  I WindowShade false
  +  I $0

  Style  *  WindowShadeShrinks , NoPPosition , HintOverride , GNOMEIgnoreHints \
    , NoIcon , StickyIcon , MwmDecor , MwmButtons

  Style  *  FPLenient \
    , FPClickRaisesFocused      , FPClickRaisesUnfocused \
    , FPClickDecorRaisesFocused , FPClickDecorRaisesUnfocused \
    , FPClickIconRaisesFocused  , FPClickIconRaisesUnfocused \
    , FPGrabFocus , FPReleaseFocus , FPFocusByFunctionWarpPointer \
    , FPAllowRaiseClickFunction

  Style * ClickToFocusPassesClickoff , ClickToFocusRaises \
    , MouseFocusClickRaises , MouseFocus

  Style *  DecorateTransient \
    , DontLowerTransient , RaiseTransient \
    , StackTransientParent , StartsOnPageIncludesTransients

  Style  *  MinOverlapPercentPlacement
  Style  *  MinOverlapPercentPlacementPenalties 3 1 0 0

  Style  ignore-pos  NoPPosition , NoUSPosition , NoTransientPPosition
  Style  ignore-pos  HintOverride , GNOMEIgnoreHints

  Style  avoid  UseStyle ignore-pos , SkipMapping \
    , StartIconic , IconifyWindowGroups , StartsLowered , NeverFocus

  Style  netscape  TitleAtBottom , StartsRaised

  Style  *Communicator*       UseStyle netscape
  Style  *Netscape*           UseStyle netscape
  Style  *Navigator*          UseStyle netscape
  Style  *Netscape*Download*  Slippery , SkipMapping
  Style  *Netscape*popup*     Slippery , SkipMapping
  Style  *Netscape*Error*     Slippery , SkipMapping , Layer 10 \
    , StaysPut , StaysOnTop
  #
  Style  *question*popup*     Slippery , SkipMapping
  Style  Mozilla*             UseStyle netscape , SkipMapping
  Style  navigator:browser    UseStyle netscape , SkipMapping
  Style  Saving*              UseStyle avoid
  Style  *%*of*Saved*         UseStyle avoid
  Style  *Default*Plugin*     UseStyle avoid , StickyIcon

5.6 kB core stack follows, which is also available from...

  http://www103.pair.com/parv/tmp/fvwm-2.5.12-mozilla-stuck-core-stack

  - Parv

GNU gdb 4.18 (FreeBSD)
...
warning: core file may not match specified executable file.
Core was generated by `fvwm'.
Program terminated with signal 6, Abort trap.
Reading symbols from /usr/X11R6/lib/libXpm.so.4...done.
Reading symbols from /usr/X11R6/lib/libSM.so.6...done.
Reading symbols from /usr/X11R6/lib/libICE.so.6...done.
Reading symbols from /usr/X11R6/lib/libXext.so.6...done.
Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
Reading symbols from /usr/lib/libm.so.2...done.
Reading symbols from /usr/X11R6/lib/libXrender.so.1...done.
Reading symbols from /usr/local/lib/libpng.so.5...done.
Reading symbols from /usr/lib/libz.so.2...done.
Reading symbols from /usr/lib/libxpg4.so.3...done.
Reading symbols from /usr/lib/libc.so.4...done.
Reading symbols from /misc/local/X11/lib/libXThrStub.so.6...done.
Reading symbols from /misc/local/X11/lib/X11/locale/lib/common/xlcDef.so.2...done.
Reading symbols from /usr/X11R6/lib/libXcursor.so.1...done.
Reading symbols from /misc/local/X11/lib/X11/locale/lib/common/xomGeneric.so.2...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0  0x807dfe4 in DeIconify (fw=0x8144c00) at icons.c:2283
2283				if (t != fw && FW_W_TRANSIENTFOR(fw) == FW_W(t))
(gdb) bt
#0  0x807dfe4 in DeIconify (fw=0x8144c00) at icons.c:2283
#1  0x807e8b9 in CMD_Iconify (cond_rc=0xbfbfe6f8, exc=0x8148200, action=0x8113e28 "false") at icons.c:2674
#2  0x80972b8 in __execute_function (cond_rc=0xbfbfe6f8, exc=0x8148180, action=0x8121400 "Iconify false", 
    exec_flags=128 '\200', args=0xbfbfe1c4) at functions.c:630
#3  0x809761a in __run_complex_function_items (cond_rc=0xbfbfe6f8, cond=105 'i', func=0x811f380, 
    exc=0x8148180, args=0xbfbfe1c4) at functions.c:820
#4  0x80979a6 in execute_complex_function (cond_rc=0xbfbfe6f8, exc=0x8148100, 
    action=0x813eae9 "deiconify-func Raise", desperate=0xbfbfe260) at functions.c:1001
#5  0x8097308 in __execute_function (cond_rc=0xbfbfe6f8, exc=0x8148080, 
    action=0x8112120 "Function deiconify-func Raise", exec_flags=128 '\200', args=0xbfbfe414)
    at functions.c:649
#6  0x809761a in __run_complex_function_items (cond_rc=0xbfbfe6f8, cond=105 'i', func=0x8112100, 
    exc=0x8148080, args=0xbfbfe414) at functions.c:820
#7  0x80979a6 in execute_complex_function (cond_rc=0xbfbfe6f8, exc=0x8148000, 
    action=0x813eaa0 "WindowListFunc 42170379", desperate=0xbfbfe4b0) at functions.c:1001
#8  0x8097308 in __execute_function (cond_rc=0xbfbfe6f8, exc=0x814bf80, 
    action=0x8114192 "WindowListFunc 42170379", exec_flags=128 '\200', args=0x0) at functions.c:649
#9  0x8097e3e in execute_function (cond_rc=0xbfbfe6f8, exc=0x814bf80, 
    action=0x8114192 "WindowListFunc 42170379", exec_flags=128) at functions.c:1241
#10 0x8097f19 in execute_function_override_window (cond_rc=0xbfbfe6f8, exc=0x814bf00, 
    action=0x8114192 "WindowListFunc 42170379", exec_flags=128 '\200', fw=0x8144c00) at functions.c:1291
#11 0x809c44a in CMD_WindowId (cond_rc=0xbfbfe6f8, exc=0x814bf00, action=0x8114192 "WindowListFunc 42170379")
    at conditional.c:1533
#12 0x80972b8 in __execute_function (cond_rc=0x0, exc=0x814be80, 
    action=0x8114180 "WindowId 42170379 WindowListFunc 42170379", exec_flags=64 '@', args=0x0)
    at functions.c:630
#13 0x8097e3e in execute_function (cond_rc=0x0, exc=0x814be80, 
    action=0x8114180 "WindowId 42170379 WindowListFunc 42170379", exec_flags=64) at functions.c:1241
#14 0x804d331 in __menu_execute_function (pexc=0xbfbfe9dc, 
    action=0x8114180 "WindowId 42170379 WindowListFunc 42170379") at menus.c:232
#15 0x8055381 in do_menu (pmp=0xbfbfeb84, pmret=0xbfbfeab8) at menus.c:6562
#16 0x80a19af in CMD_WindowList (cond_rc=0xbfbff0c8, exc=0x814bc80, 
    action=0x811ed0b "Root c c Sticky,   OnTop,   NoGeometryWithInfo,  NoDeskNum,  NoNumInDeskTitle,   MaxLabelWidth 30, IconifiedAtEnd,    SortByResource") at windowlist.c:1070
#17 0x80972b8 in __execute_function (cond_rc=0xbfbff0c8, exc=0x814bc00, 
    action=0x811e000 "WindowList Root c c Sticky,   OnTop,   NoGeometryWithInfo,  NoDeskNum,  NoNumInDeskTitle,   MaxLabelWidth 30, IconifiedAtEnd,   $*", exec_flags=128 '\200', args=0xbfbfedd4) at functions.c:630
#18 0x809761a in __run_complex_function_items (cond_rc=0xbfbff0c8, cond=105 'i', func=0x8112220, 
    exc=0x814bc00, args=0xbfbfedd4) at functions.c:820
#19 0x80979a6 in execute_complex_function (cond_rc=0xbfbff0c8, exc=0x814bb80, 
    action=0x8128609 "window-list  SortByResource", desperate=0xbfbfee70) at functions.c:1001
#20 0x8097308 in __execute_function (cond_rc=0xbfbff0c8, exc=0x814bb00, 
    action=0x811d140 "Function window-list  SortByResource", exec_flags=128 '\200', args=0xbfbff024)
    at functions.c:649
#21 0x809761a in __run_complex_function_items (cond_rc=0xbfbff0c8, cond=105 'i', func=0x811f020, 
    exc=0x814bb00, args=0xbfbff024) at functions.c:820
#22 0x80979a6 in execute_complex_function (cond_rc=0xbfbff0c8, exc=0x814ba80, 
    action=0x813e9c9 "window-list-sorted", desperate=0xbfbff0c0) at functions.c:1001
#23 0x8097308 in __execute_function (cond_rc=0x0, exc=0x814b900, 
    action=0x81126a0 "Function window-list-sorted", exec_flags=0 '\000', args=0x0) at functions.c:649
#24 0x8097e3e in execute_function (cond_rc=0x0, exc=0x814b900, 
    action=0x81126a0 "Function window-list-sorted", exec_flags=0) at functions.c:1241
#25 0x8060808 in __handle_key (ea=0xbfbff2e8, is_press=1) at events.c:2416
#26 0x80608f8 in HandleKeyPress (ea=0xbfbff2e8) at events.c:2455
#27 0x8061fb4 in dispatch_event (e=0xbfbff340) at events.c:3759
#28 0x8062062 in HandleEvents () at events.c:3804
#29 0x8082593 in main (argc=4, argv=0xbfbff73c) at fvwm.c:2520

-- 

--
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, 17 Oct 2004 12:20:00 +0200

> WindowListFunc & related functions and focus & placement related

[snip]

I can not reproduce the problem, but I can see a bug in the code:
If a transient window is iconified by its parent window and then
loses the special relationship, for example because the parent is
closed, a loop in the DeIconify() function never exits.

I have committed a patch to CVS for 2.5.13 and 2.4.19.

> 5.6 kB core stack follows, which is also available from...

[snip]

> #1  0x807e8b9 in CMD_Iconify (cond_rc=0xbfbfe6f8, exc=0x8148200, action=0x8113e28 "false") at icons.c:2674

You said it also happens when the window is just raised, not
(de)iconifed.  Does it hang in the same place in this case?

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]

---

From: Parv <[email-masked]>
Date: Tue, 19 Oct 2004 16:38:22 -0400

in message <[email-masked]>,
wrote fvwm-w thusly...
> I can not reproduce the problem,

I notice it mainly when sometimes a "Saving ..." mozilla window is
tried to be deiconified/raised.  Does not happen often, only when
downloading a large file (so that "Saving..." window will remain for
longer and deiconifying it will let me know the local path for the
remote file).

> I can see a bug in the code:
> closed, a loop in the DeIconify() function never exits.  I have
> committed a patch

Thanks.

> to CVS for 2.5.13 and 2.4.19.

Do you really mean 2.4.19 not 2.4.20 (implying that fix is available
in stable release, fix for unstable is only in CVS)?

> (de)iconifed.  Does it hang in the same place in this case?

Sheepishly say i ... you see, i was using a function which would
unconditionally raise & deiconify the window (from WindowListFunc);
i cannot confidently say if window raising would also cause, or is
part of, the problem in any way.  The trace apparently shows
problem, for now, only w/ the deiconification.

  - Parv

--

---

From: Parv <[email-masked]>
Date: Tue, 19 Oct 2004 16:47:59 -0400

> I have committed a patch to CVS for 2.5.13

I have generated the patch (from 2.5.12 & CVS via ftp)  below for
icons.c.  Is this sufficient?

  - Parv

(Mind the embedded tabs in the patch)

--- fvwm/icons.c.orig	Wed Mar 17 09:42:54 2004
+++ fvwm/icons.c	Tue Oct 19 16:13:55 2004
@@ -2251,7 +2251,7 @@
  */
 void DeIconify(FvwmWindow *fw)
 {
-	FvwmWindow *t,*tmp;
+	FvwmWindow *t, *tmp, *ofw;
 	FvwmWindow *sf = get_focus_window();
 	rectangle icon_rect;
 	XWindowAttributes winattrs = {0};
@@ -2276,15 +2276,18 @@
 		SET_ICONIFY_AFTER_MAP(fw, 0);
 		return;
 	}
-	while (IS_ICONIFIED_BY_PARENT(fw))
+	for (ofw = NULL; fw != ofw && IS_ICONIFIED_BY_PARENT(fw); )
 	{
-		for (t = Scr.FvwmRoot.next; t != NULL; t = t->next)
+		t = get_transientfor_fvwmwindow(fw);
+		if (t != NULL)
 		{
-			if (t != fw && FW_W_TRANSIENTFOR(fw) == FW_W(t))
-			{
-				fw = t;
-			}
+			ofw = fw;
+			fw = t;
 		}
+	}
+	if (IS_ICONIFIED_BY_PARENT(fw))
+	{
+		SET_ICONIFIED_BY_PARENT(fw, 0);
 	}
 
 	/* AS dje  RaiseWindow(fw); */
>> EOF <<

--

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 26 Oct 2004 10:07:18 +0200

> icons.c.  Is this sufficient?

Yes.  Does it work?

Ciao

Dominik ^_^  ^_^

---

From: Parv <[email-masked]>
Date: Tue, 26 Oct 2004 23:59:12 -0400

in message <[email-masked]>,
wrote fvwm-w thusly...
> > I have generated the patch (from 2.5.12 & CVS via ftp)  below
> > for icons.c.  Is this sufficient?
> 
> Yes.  Does it work?

Well, so far there has not been a lock up.  Now, only if i could
reproduce the problem on demand.

  - Parv

--