1.5.25: Problem with XtAppAddWorkProc and OptionMenu
Wakker, P.H. (Pieter)
Fri Jul 10 08:20:00 GMT 2009
I am running CYGWIN 1.5.25 on Windows XP pack 2. I have a XWindows
graphics program that uses several XmOptionMenu widgets. The problem is
that whenever the user clicks frequently (sometimes a double-click is
enough) on these OptionMenu's the program crashes with a segmentation
error. This behaviour is not noticeable with the same program on HP-UX.
I reproduced the problem in the test program below. It seems as if the
combination of the WorkProc and the OptionMenu causes the problem. If I
remove the XtAppAddWorkProc statement there is no problem, but the only
widget that causes the crash is an OptionMenu (for example with a
PushButton I can't reproduce the crash).
Another thing I noticed is that when I reduce the number of microseconds
in the usleep command, I have to click faster to make the program crash.
It seems as if there is a relationship with how long the program is busy
in the WorkProc. In the actual program the usleep is replaced by
something useful of course.
Any help is appreciated.
TopLevel = XtVaAppInitialize(&app,"Test",NULL,0,&argc,argv,NULL,NULL);
form = XtVaCreateManagedWidget( "Test",
wdg1 = XmCreatePulldownMenu(form, "pulldown", NULL, 0);
wdg2 = XtVaCreateManagedWidget("1", xmPushButtonWidgetClass, wdg1,
wdg3 = XtVaCreateManagedWidget("2", xmPushButtonWidgetClass, wdg1,
wdg4 = XmCreateOptionMenu(form, "TEST", NULL, 0);
XtVaSetValues(wdg4, XmNsubMenuId, wdg1);
XtAppAddWorkProc(app, (XtWorkProc) ViewerCheck, (XtPointer) NULL);
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin-xfree