Menu

#25 Crash in Xt's InitTimes() with file selection dialog

open
nobody
Xm library (13)
5
2009-07-08
2008-04-02
No

LessTif 0.95.0 with the sources patched to include the changes in CVS as of 10 August 2007 and the patches included with bugs #1772175 and #1773603 was configured with

env CFLAGS=-Os ./configure -powerpc --with-x --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --enable-production --disable-debug

on a Mac OS X 10.2 system (the compiler was Apple's version of gcc 3.1) with the X libraries from XDarwin's packaging of XFree86 4.2. When the library configured that way was used on a different Mac OS X system (10.3 with Apple's X11 1.0), an application using the LessTif library on that system would crash when the user changed directories in a file selection dialog. The functions on the top of the stack at the time of the crash were:

InitTimes()
_XtWaitForSomething()
WaitForWM()
_XmRootGeometryManager()
_XtMakeGeometryRequest()
XtMakeGeometryRequest()
geometry_manager()
GeometryHandlerWrapper()
_XtMakeGeometryRequest()
XtMakeGeometryRequest()
_XmMakeGeometryRequest()
_XmHandleSizeUpdate()
_XmBulletinBoardSizeUpdated()
_XmFileSelectionSearch()
_XmFsbButton()

I did not encounter any similar crashes using the LessTif library on the system where it was compiled.

The problem appears to be caused by _XtWaitForSomething() taking different numbers of arguments depending on how libXt was compiled. Because lib/Xm-2.1/Vendor.c in LessTif calls _XtWaitForSomething() directly, using the same LessTif library binary on different systems is only safe if the systems have versions of libXt with the same prototype for the internal function _XtWaitForSomething().

Discussion

  • Eric Branlund

    Eric Branlund - 2008-04-02

    proposed patch

     
  • Eric Branlund

    Eric Branlund - 2008-04-02

    Logged In: YES
    user_id=373132
    Originator: YES

    The attached patch removes the call to _XtWaitForSomething() from lib/Xm-2.1/Vendor.c. While that resolves the problem cited in the bug report, the implementation in the patch has at least two drawbacks when compared to the old version of Vendor.c:

    1) The old version of _XmRootGeometryManager() would return XtGeometryYes in the case where an Xt warning message about a broken window manager was generated; this version returns XtGeometryNo.

    2) Geometry requests passed on to the window manager incur extra overhead because _XmRootGeometryManager() now works up the Widget class hierarchy to find the routine (in typical cases it will be Xt's RootGeometryManager()) which will handle the interaction with the window manager.

    The patch was computed against LessTif files from CVS as of 31 March 2008. The patch can be applied by running

    patch -Np1 <name_of_patch_file

    from the top-level directory for the LessTif files.

    File Added: lesstif-0.95.0-vendorshell-patch.txt

     
  • Paul Gevers

    Paul Gevers - 2009-07-08
    • labels: 103129 --> Xm library
     

Log in to post a comment.