Subject: pkg/15040: xdm3d dumps core if the loginmoveInterval resource is not set
To: None <>
From: None <kre@munnari.OZ.AU>
List: netbsd-bugs
Date: 12/24/2001 01:07:44
>Number:         15040
>Category:       pkg
>Synopsis:       xdm3d dumps core if the loginmoveInterval resource is not set
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 23 21:23:01 PST 2001
>Originator:     Robert Elz
>Release:        NetBSD 1.5Z (-current 20011212) (pkgsrc 20011218)
	Prince of Songkla University
	<The following information is extracted from your kernel. Please>
	<append output of "ldd", "ident" where relevant (multiple lines).>
System: NetBSD fuchsia 1.5Z NetBSD 1.5Z (FUCHSIA) #3: Wed Dec 12 01:54:04 ICT 2001 kre@fuchsia:/usr/obj/sys/FUCHSIA i386
Architecture: i386
Machine: i386
	If the DisplayManager*loginmoveInterval resource is not set
	(or is explicitly set to -1) then when the first charater is
	typed at the login window, xdm3d will dump core.

	Set up xdm3d, delete (or comment out) the
		DisplayManager*loginmoveInterval:             10
	that is supplied in xdm-config by default, start it running,
	and attempt to login.
	The problem is an attempt to remove a timeout that is not
	set (to keep the login window still while typing at it).
	Just don't do that...

	Add the patch in the following shar file to the patches
	diorectory (patches/patch-ad - if you're seeing this before
	the companion PR, the other one adds -ab and -ac to get around
	some xpkgwedge problems).

	I also added some "belt and braces" type checking, and made the
	timeouts not happen if the loginmoveInterval resource is set to
	0 (as well as any value < 0).   I'm not sure what would be supposed
	to happen with a move every 0 seconds, but it didn't seem rational
	to me - feel free to ignore that part of the change if appropriate.

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
# This archive contains:
#	patches/patch-ad
echo x - patches/patch-ad
sed 's/^X//' >patches/patch-ad << 'END-of-patches/patch-ad'
X+++ greeter/greet.c	Sun Dec 23 23:45:13 2001
X@@ -122,6 +122,9 @@
X d = (struct display *) closure;
X+if (d->loginmoveInterval <= 0)
X+	return;
X scrn = XDefaultScreenOfDisplay(dpy);
X /*
X XtSetArg (args[0], XtNwidth, (XtArgVal) &width);
X@@ -255,7 +258,7 @@
X 		    0, 0, 0, 0,
X 		    XWidthOfScreen(scrn) / 2,
X 		    XHeightOfScreen(scrn) / 2);
X-    if (d->loginmoveInterval > -1)
X+    if (d->loginmoveInterval > 0)
X         moveTimeout = XtAppAddTimeOut (context, d->loginmoveInterval*10000, time_test, (XtPointer) d);
X     if (d->pingInterval)
X@@ -315,7 +318,7 @@
X     while (!done) {
X 	    XtAppNextEvent (context, &event);
X 	/* by Amit Margalit 19-Apr-1997 */
X-	    if(event.type == KeyPress)
X+	    if(moveTimeout && event.type == KeyPress)
X 	    {	/* reset the timeout as long as we type it stays in place */
X 	      XtMoveWidget(toplevel,orig_x,orig_y);
X 	      XtRemoveTimeOut(moveTimeout);

 	<Please check that the above is correct for the bug being reported,>
 	<and append source date of snapshot, if applicable (one line).>