[6239] in Athena Bugs

home help back first fref pref prev next nref lref last post

vax 7.1H: X11r4 Xaw clock widget

daemon@ATHENA.MIT.EDU (vanharen@ATHENA.MIT.EDU)
Thu Oct 18 15:34:15 1990

From: vanharen@ATHENA.MIT.EDU
To: bugs@ATHENA.MIT.EDU
Date: Thu, 18 Oct 90 15:33:58 EDT

System name:		fries
Type and version:	CVAXSTAR 7.1H (2 update(s) to same version)
Display type:		SM

What were you trying to do?
	Change a clock widget from digital to analog mode.

What's wrong:
	It crashes the X server (on a vax).

What should have happened:
	It should not crash the X server, and the clock should change
	from digital to analog mode.

Please describe any relevant documentation references:
	(Documentation?  Ha!  The clock widget is not documented
	anywhere, that I could find...)  Anyway, here is some code that
	demonstrates this problem (and some comments after):

==============================================================================
#include <X11/Xatom.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>

#include <X11/Xaw/Clock.h>
#include <X11/Xaw/Cardinals.h>

Widget clock;
void change();

void main(argc, argv)
    int argc;
    char **argv;
{
    Widget toplevel;
    XtAppContext app_con;

    toplevel = XtAppInitialize (&app_con, "XClock", NULL, 0,
				(Cardinal *)&argc, argv, NULL, NULL, ZERO);

    clock = XtCreateManagedWidget ("clock", clockWidgetClass, toplevel,
				   NULL, ZERO);
    XtRealizeWidget (toplevel);
    XtAppAddTimeOut(app_con, 10 * 1000, change, 0);
    XtAppAddTimeOut(app_con, 20 * 1000, change, 1);
    XtAppMainLoop (app_con);
}

void change(data, timerid)
    int data;
    XtIntervalId *timerid;
{
    Arg args[1];

    XtSetArg(args[0], XtNanalog, data);
    XtSetValues(clock, args, 1);
}
==============================================================================

Compile this, with:

	cc  -o  xclockfoo  xclock.c  -lXaw -lXmu -lXt -lX11 -lm

(I called it xclockfoo so that my personal resorces would not screw up
the demo.)

Now, run it, like so:

	xclockfoo  -xrm  "*update: 1"

Wait ten seconds, and watch the clock change from analog to digital
mode.  Wait ten more, and watch it change from digital back to analog.
This is fine.  (The update: 1 is so you won't get impatient.)

Now, run it again, like so:

	xclockfoo  -xrm  "*update: 1"  -xrm "*analog: false"

Wait 20 seconds, and blammo, kiss your X server goodbye.  (I would
advise running this on a machine that you aren't really trying to use.)

On an RT, it doesn't crash, but it does do weird things, until you
resize the window, and then it figures out how big it is and is OK.

So, there seem to be a few things wrong here...

	The setvalues procedure for the clock widget is probably broken.
	The vax X server should not die inside mfbBlackSolidFS, when
		handed bogus arguments.
	The clock widget should be documented, and if it is dangerous to
		do a setvalues on XtNanalog, this should be documented.

home help back first fref pref prev next nref lref last post