Hello Lesstif development group.
--------------------------------

I tried out the new Lesstif 0.90.0. In the announcement you
made you asked for examples of motif programs that do not run
on Lesstif. Here is an one. At:

http://www.bredex.de/vdx/home.htm

one can download vdx (vdx-1.2.1-src.tar.gz). This used to be a
commercial UIMS, but recently this code has been GPL'ed. Vdx
run's on commercial motif versions, but does not run on
Lesstif.


Unpacking the file creates a directory vdx. In the subdirectory
config, edit the file Makeoptions.linux-m1.2 to set the debug
switches. The program can be build with the build script

1) hpux-matzen
2) linux-cde
3) linux-m1.2
4) linux-m2.0
5) linux-m2.0s
6) linux-m2.0s-debug
7) linux-m2.0xrt
8) linux-m2.1
9) linux-m2.1-glibc
10) linux-m2.1-lac
11) solaris
Enter configuration to build

My system is a x86 Redhat 6.1 system, and I select 3)
linux-m1.2. I first have to fix a compiler error in
src/lic/lic.C

lic.C:166: new declaration `int __ctype_get_mb_cur_max()'
/usr/include/stdlib.h:80: ambiguates old declaration `size_t
__ctype_get_mb_cur_max()'
make[2]: *** [linuxelf-m1.2/lic.o] Error 1

Just comment out some lines, and redo the build and select 3)


The program has created a target runtime environment:

/home/arge/vdx/install/vdx-v1.2.1-linuxelf-m1.2

but has stripped the executable. Copy

./src/lic/linuxelf-m1.2/vdx.bin

over

./install/vdx-v1.2.1-linuxelf-m1.2/bin/vdx.bin

and add the following to your environment (supposing unpaking
was done in /home/arge/vdx):

--------------------------------------------------------------
VDX_HOME="/home/arge/vdx/install/vdx-v1.2.1-linuxelf-m1.2"

XFILESEARCHPATH=$XFILESEARCHPATH:$VDX_HOME/lib/X11/%L/%T/%N%S:$VDX_HOME/lib/X11/%T/%N%S:/usr/lib/X11/%T/%N%S

export XFILESEARCHPATH VDX_HOME

export LD_LIBRARY_PATH=$VDX_HOME/lib:$LD_LIBRARY_PATH
--------------------------------------------------------------


Now vdx.bin can be started. I start the program in ddd for
debugging purposes.

The vdx main windows appears, along with a quick start dialog
to open a project. Close the quick start dialog. Select the
Widget menu in the menu bar, and select palette. The widgets
palette is popped up. Select a TopLevelShell (third icon in the
shells part, a drag a window of some size. The program crashes
with a Segmentation fault. What is happening is the following:

gdb output:

--------------------------------------------------------------
Program received signal SIGSEGV, Segmentation fault.
strcmp (p1=0x1c <Address 0x1c out of bounds>, p2=0x8120886
"numChildren")
    at ../sysdeps/generic/strcmp.c:38
Current language:  auto; currently c
(gdb) where
#0  strcmp (p1=0x1c <Address 0x1c out of bounds>, p2=0x8120886
"numChildren")
    at ../sysdeps/generic/strcmp.c:38
#1  0x8064162 in createLresource (r=@0x8364998, partOf=0x8307d28) at
Lresource.C:1261
#2  0x8065578 in Lproperty::Lproperty (this=0x8307dd0, papi=0x8307d28,
widgetClass=0x401dde20,
    parentClass=0x0, first_res=0x0) at Lproperty.C:97
#3  0x80556af in Lwidget::Lwidget (this=0x8307d28, aclass=0x8200990,
    name=0xbfffe68c "Interface_1", wo=@0xbfffe678) at Lwidget.C:136
#4  0x8052b55 in Linterface::Linterface (this=0x8307cb8,
shellClass=0x8200990) at Lproject.C:860
#5  0x8051210 in Lproject::addInterface (this=0x82740c8,
shellClass=0x8200990) at Lproject.C:506
#6  0x805f664 in Lcreator::createLwidget (this=0x8200990, parent=0x0) at
Lcreator.C:475
#7  0x80606ee in LcreatorIcon::select (this=0x83189d8, b=0 '\000',
x=122, y=8) at Lcreator.C:767
#8  0x810b3b7 in SensitiveContainer::button (this=0x8310d40,
event=0xbffff320, x=122, y=8,
    key=256) at SensitiveView.C:1256
#9  0x81097e6 in SensitiveContainer::button_press (this_class=0x8310d40,
event=0xbffff320)
    at SensitiveView.C:897
#10 0x401ad275 in XtDispatchEventToWidget () from
/usr/X11R6/lib/libXt.so.6
#11 0x401adead in _XtDefaultDispatcher () from /usr/X11R6/lib/libXt.so.6

#12 0x401ae173 in XtDispatchEvent () from /usr/X11R6/lib/libXt.so.6
#13 0x401ae669 in XtAppMainLoop () from /usr/X11R6/lib/libXt.so.6
#14 0x80ec986 in LicView::run () at LicView.C:384
#15 0x8068014 in main (argc=1, argv=0xbffffa24) at lic.C:160
--------------------------------------------------------------


In

src/lic/Lproperty.C

in the constructor a pointer to a XmSecondaryResourceData is
declared.

XmSecondaryResourceData *secRes;

some further in the function a call to
XmGetSecondaryResourceData is done:

numSecRes = XmGetSecondaryResourceData(widgetClass, &secRes);

Dereferencing the secRes pointer, gives all kinds of out of
bounds pointers causing the program to crash.

Is the XmGetSecondaryResourceData a motif 2.x convenience
function, or does this function give highly questionable
results on Lesstif.


Greetings,

[EMAIL PROTECTED]


Reply via email to