Operating System - OpenVMS
1748053 Members
4875 Online
108758 Solutions
New Discussion юеВ

Re: Change in program behavior going from Motif 1.2-6 to 1.3-1

 
Gib Copeland
Occasional Advisor

Change in program behavior going from Motif 1.2-6 to 1.3-1

Under 1.2-6 (VMS 7.3-1) this program simply exits. After upgrading to 1.3-1 (VMS 7.3-2)
calls to either XtAppPending or XtAppProcessEvent result in a continuous print out of the line:

X Toolkit Warning: Select failed; error code 65535

Any ideas?

Thanks,
Gib Copeland

#include
XtAppContext sess_ctx;
main()
{
sess_ctx = XtCreateApplicationContext();
while (XtAppPending( sess_ctx ))
XtAppProcessEvent( sess_ctx, XtIMAll );
}
9 REPLIES 9
Kris Clippeleyr
Honored Contributor

Re: Change in program behavior going from Motif 1.2-6 to 1.3-1

Hi Gib,

I think you may report this to HP as being a bug in the newer versions of DECwindows Motif. I saw the same phenomenon on VMS E8.2 (field test).

Kris
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Martin Kirby_1
Advisor

Re: Change in program behavior going from Motif 1.2-6 to 1.3-1

Gib (or Kris),

Please escalate. There is certainly something wrong there and the code that handles waits in Xt in V1.3-1 is very different to that in V1.2-6 (it is now basically that from X.Org).

There are really two problems here:
1) That the code is looping uselessly
2) That the error message is printing the errno rather than the vaxc$errno with the real error in it.

Regards,

Martin Kirby
A DECwindows maintainer
Kris Clippeleyr
Honored Contributor

Re: Change in program behavior going from Motif 1.2-6 to 1.3-1

Martin (and Gib),

I entered a problem report in the Problem Tracking and Reporting system (PTR).

Regards,

Kris
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Gib Copeland
Occasional Advisor

Re: Change in program behavior going from Motif 1.2-6 to 1.3-1

The problem seems to be caused by using XtCreateApplicationContext. If I use XtAppInitialize instead, I don't see this error (though I haven't tested this change in the original app that the reproducer came from):

#include
XtAppContext sess_ctx ;
int main(int argc, char **argv)
{
Widget toplevel;

toplevel = XtAppInitialize(&sess_ctx,
"apptest", NULL, 0, &argc, argv, NULL,
NULL, 0);
while ( 1 )
XtAppProcessEvent(sess_ctx, XtIMAll);
}
Brad McCusker
Respected Contributor

Re: Change in program behavior going from Motif 1.2-6 to 1.3-1

I'm glad this is PTR'd. However, I am very certain that we have seen this before, but, its been a while - I would expect that its been fixed. I'm trying to find the last time we saw this.

In the mean time, please make sure you are current with any ECO kits for Motif (if there are any).

Brad McCusker
Brad McCusker
Software Concepts International
Martin Kirby_1
Advisor

Re: Change in program behavior going from Motif 1.2-6 to 1.3-1

Brad,

There was a fix to loop forever rather than returning an error when NextEvent (or similar) was called with no displays, timers, or input event flags. This was made in V1.2-5 (in 1996). I think this may be what you are thinking of.

However, that whole code area has been replaced in V1.3-1 by the X.Org sample version and includes new functionality for Xt Signals, multi-threading and other X11R6 additions.

Martin Kirby
Kris Clippeleyr
Honored Contributor

Re: Change in program behavior going from Motif 1.2-6 to 1.3-1

Guys,

Got a reply from engineering.
Here it is:



The case reproducer does not present a valid program as it lacks
initialization of the X Toolkit Intrinsics. The X Toolkit Spec
(X Toolkit Intrinsics - C Language Interface. X Window
System. X Version 11, Release 6.4. First Revision - April 1994.
By Joel McCormack, Paul Assente & Ralph R. Swick. X Consortium, Inc.)
reads in par. 2.1. Initializing the X Toolkit:

Before an application can call any Intrinsics function other than
XtSetLanguageProc and XtToolkitThreadInitialize, it must initialize the
Intrinsics by using

. XtToolkitInitialize, which initializes the Intrinsics internals
. XtCreateApplicationContext, which initializes the per-application state
. XtDisplayInitialize or XtOpenDisplay, which initializes the per-display
state
. XtAppCreateShell, which creates the root of a widget tree

Or an application can call the convenience procedure XtOpenApplication,
which combines the functions of the preceding procedures.

(End of quote)

From "Appendix C. Compatibility Functions" of the same document:

XtAppInitialize and XtVaAppInitialize have been replaced by XtOpenApplication
and XtVaOpenApplication.

(End of quote)

The XT library in DECwindows Motif V1.3 adopted sources of X org
from Release X11R6.6 and would not allow to call the X toolkit
routines without initialization.

With this consideration it should not surprise that modification
of the reproducer reported in ITRC OpenVMS forum by Brad McCusker
who replaced XtCreateApplicationContext call with XtAppInitialize,
allowed the program to run and exit smoothly.

The requirement to initalization of X Toolkit Intrinsics is not new
in X11R6.4. In Programmer's Guide for OSF/Motif Release 1.1
(OSF/Motif Programmer's Guide. Revision 1.1. Open Software
Foundation. PTR Prentice Hall, 1991) you may find in par. 3.3.
Initializing the Xt Intrinsics:

You must initialize the Xt Intrinsics before making any other calls
to Xt Intrinsics functions. The function XtAppInitialize creates an
application context, establishes the connection to the display server,
parses the command line that invoked the application, loads the resource
database, and creates a shell widget to serve as the parent of your
application widget.

(End of quote)

However implementation of the XtAppPending call for VMS in DWM V1.2
did not follow closely the X org sources. Rather than calling
the transport routine in V1.3, the XtAppPending in V1.2 checks
and returns the input event mask. As no input events are added
in the reproducer, XtAppPending returns zero and the program
exit without any calls to XtAppProcessEvent.

I am wondering is there a real program that runs successfully
with DWM V1.2-6 but loops the warning message when runs against
V1.3-1? If it is the case, the program needs to be modified to
orderly initialize the X Toolkit Intirnsics.

Though the XT library in V1.3 is not responsible for the reproducer
failure, the case demonstrated the flaws in error handling: rather
than to exit with a meaningful error message the library loops
the warning message with undecoded numerical error.

I believe that the case can be closed and the bugs in error handling,
secondary to the case, should be addressed in the future DWM release
or ECO.

Alex Zaslavsky



So basically, follow the manuals closely.

Regards,

Kris
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Gib Copeland
Occasional Advisor

Re: Change in program behavior going from Motif 1.2-6 to 1.3-1

Yes of course, the application I drew the example from was broken (but worked anyway) to begin with. When I discovered a work around (which I reported here, and apparently may not work in some future Motif release as XtAppInitialize has been replaced) I closed my problem report. My issue is with forward compatibility and how to deal with the lack of such.

Another example can be found in XtRemoveTimeOut
I've found instances where the applications I'm working with used to pass a null timer id (for whatever reasons). Motif 1.3-1 is not nearly as gracious as 1.2-6 was when receiving such a gift!
Vouters
Advisor

Re: Change in program behavior going from Motif 1.2-6 to 1.3-1

Hi Gib,

The code at the following URL http://h18000.www1.hp.com/support/asktima/operating_systems/00A30722-4DAEF617-1C02A1.html works for both Motif 1.2 as found on OpenVMS Alpha V7.3-2 or Tru64 V5.1B PK3 and Motif 2.1 as found on HP-UX and Solaris. It uses XtVaOpenApplication to create the top-level widget. You may give it a try to see whether it works on your computer.

Philippe