[comp.windows.x] Suggested fix for "awm -e" abort problem

tom@ICASE.EDU (Tom Crockett) (12/14/88)

			  X Window System Bug Report
			    xbugs@expo.lcs.mit.edu




VERSION:
    R3 + fixes 1-2 + Purdue-speedups

CLIENT MACHINE and OPERATING SYSTEM:
    Sun 3/50 running SunOS 3.5

DISPLAY:
    Sun BW2

WINDOW MANAGER:
    awm

AREA:
    awm from R3 contrib distribution + patch08

SYNOPSIS:
    Awm aborts when using the -e option to initiate an X session.

DESCRIPTION:
    The command "xinit awm -e .xinitrc" or anything roughtly equivalent fails
    due to awm dumping core.  This is only observed to occur if awm is used to
    start all other initial clients on the display.  If any other clients
    create windows before "awm -e" is invoked, the problem is not seen.  The
    problem is also seen using "xdm" if "awm -e" is used to start the 
    remaining clients.

REPEAT BY:
    Try "xinit awm -e .xinitrc".  It always fails on our system.  Other users
    with different configurations report that they do not see the problem.
    However, it seems likely that the bug still exists, but is not causing a
    fatal error on those systems.

SAMPLE FIX:

    The code seems to be making a poor assumption about what will be returned
    from XQueryTree in the case when there are no children of the root window.
    The following patch took care of the problem for us.

*** /tmp/awm.c	Tue Dec 13 11:09:15 1988
--- awm.c	Tue Dec 13 11:10:42 1988
***************
*** 383,389 ****
  		    XSelectInput(dpy, kiddies[i], event_mask);
  	       }
  	  }
! 	  if( *kiddies )
  	      XFree(kiddies);
       }
       /*
--- 383,389 ----
  		    XSelectInput(dpy, kiddies[i], event_mask);
  	       }
  	  }
! 	  if (nkids)
  	      XFree(kiddies);
       }
       /*