Subject: Bug#4130: Old motif applications don't run

From: Thomas Koenig <[email-masked]>
Date: Tue, 13 Aug 1996 19:43:20 +0200 (MET DST)

PACKAGE: motifnls
VERSION: 2.1-1

A commercial application (Maple VR3) does not run correctly under
X11R6 even with motifnls installed.  It complains abut unknown
keysyms osf* (for example osfCopy), even though these are defined
in /usr/X11R6/lib/X11/XKeysymDB.

The problem is that Maple looks for these things under /usr/X386,
as verified with strace.

Solution: cd /usr ; ln -s X11R6 X386
-- 
Thomas Koenig, [email-masked], [email-masked].
The joy of engineering is to find a straight line on a double
logarithmic diagram.

---

From: Michael Alan Dorman <[email-masked]>
Date: Tue, 13 Aug 1996 18:57:29 -0400

>Solution: cd /usr ; ln -s X11R6 X386

Real Solution:  Complain to your vendor about the use of inappropriate
paths.

Installing a link to /usr/X386 is inappropriate, and has been shown to
cause problems with man and other stuff.

Alternately, one might look into patching the binary, as the netscape
package does.

Mike.
--
"Don't let me make you unhappy by failing to be contrary enough...."

---

From: [email-masked]
Date: Tue, 13 Aug 96 22:03 EDT

Thomas>  PACKAGE: motifnls 
  Thomas>  VERSION: 2.1-1
  Thomas> 
  Thomas> A commercial application (Maple VR3) does not run correctly under
  Thomas> X11R6 even with motifnls installed.  It complains abut unknown
  Thomas> keysyms osf* (for example osfCopy), even though these are defined
  Thomas> in /usr/X11R6/lib/X11/XKeysymDB.
  Thomas> 
  Thomas> The problem is that Maple looks for these things under /usr/X386,
  Thomas> as verified with strace.

It works here on the version of Maple V Release 3 (dated Feb 1995) that is
available through a site license here at Queen's. All of maple is below
/usr/local/maple, and a shell script /usr/local/bin/maple, supplied by
Waterloo Software with Maple, sets

[...]	
MAPLE=/usr/local/maple
export MAPLE  
[...]
# This variable tells Maple's Motif interface where to find its resource
# files. This should be set even if TTY Maple is being run, as the user
# might still open a Motif plot window.
XAPPLRESDIR=$MAPLE/X11_defaults
export XAPPLRESDIR    

and indeed, there are plenty of osf* definitions in the files in the
directory. 

$ grep -c osf /usr/local/maple/X11_defaults/*
/usr/local/maple/X11_defaults/Maple:26
/usr/local/maple/X11_defaults/Maple2dX11m:0
/usr/local/maple/X11_defaults/Maple3dX11m:0
/usr/local/maple/X11_defaults/MapleV:26
/usr/local/maple/X11_defaults/XKeysymDB:25     

Might this be a local problem?

--
Dirk Eddelb"uttel                             http://qed.econ.queensu.ca/~edd

---

From: Thomas Koenig <[email-masked]>
Date: Wed, 14 Aug 1996 11:56:53 +0200 (MET DST)

>XAPPLRESDIR=$MAPLE/X11_defaults

Same thing here (same version, I suspect), only it doesn't work.

I have no idea where Maple gets the /usr/X386 path from.  It's not
in the Maple binary itself (or if it is, then 'grep -l X386' can't find
it), it's not in the 'maple' start script, it's not in the environment
(checked via 'printenv | grep X386').

Hmm... I just found that particular string in libX11.so.3.1.0 and in
libXt.so.3.1.0, under /usr/X11R5/lib.  Strace verivies that they
are indeed used, so that's probably where that path comes from.  The
vendor is not to blame.

So, it appears to be a problem with the xcompat package, not with
motifnls.  (And yes, Maple is an a.out binary).  Somebody please
reassign this bug report, please :-)
-- 
Thomas Koenig, [email-masked], [email-masked].
The joy of engineering is to find a straight line on a double
logarithmic diagram.

---

From: Thomas Koenig <[email-masked]>
Date: Wed, 14 Aug 1996 16:16:54 +0200 (MET DST)

[email-masked] wrote:

>  Thomas> Hmm... I just found that particular string in libX11.so.3.1.0 and
>  Thomas> in libXt.so.3.1.0, under /usr/X11R5/lib.  Strace verivies that they
>  Thomas> are indeed used, so that's probably where that path comes from.
>  Thomas> The vendor is not to blame.
>
>But those don't seem to be loaded by /usr/local/bin/maple/bin/mapleV 
>
>$ ldd /usr/local/maple/bin/mapleV
>        libm.so.4 (DLL Jump 4.5pl21) => /lib/libm.so.4.6.27
>        libc.so.4 (DLL Jump 4.5pl21) => /lib/libc.so.4.6.27    

But they're loaded by irisVxm, the graphical front end:

$ ldd irisVxm 
        libXt.so.3 (DLL Jump 3.1) => /usr/i486-linuxaout/lib/libXt.so.3.1.0
        libX11.so.3 (DLL Jump 3.1) => /usr/i486-linuxaout/lib/libX11.so.3.1.0
        libc.so.4 (DLL Jump 4.5pl21) => /lib/libc.so.4.7.2

After playing around with 'strings' in the /usr/X11R5/lib directory,
I finally hit upon a workable solution: Do a

$ export XWINHOME=/usr/X11R6

This appears to override the hard-coded paths in the X11R5 compatibility
package.

(Dirk, it might be a good idea to check wether you have something like 
this in your environment; another suspect is the XKEYSYMDB
environment variable).

Since I have no idea of how to set an environment variable from
a Debian package (and from which package to do it) I leave it
to more capable hands to reassign this bug to whatever package
is right (xbase, xcompat, or whatever).
-- 
Thomas Koenig, [email-masked], [email-masked].
The joy of engineering is to find a straight line on a double
logarithmic diagram.

---

From: [email-masked]
Date: Wed, 14 Aug 96 08:37 EDT

[...]
  Thomas> Same thing here (same version, I suspect), only it doesn't work.
[...]

  Thomas> So, it appears to be a problem with the xcompat package, not with
  Thomas> motifnls. (And yes, Maple is an a.out binary).

I don't think xcompat is the cause as I also have xcompat installed, yet it
works for me and not for you. Odd.

  Thomas>   Somebody please reassign this bug report, please :-)

If that was needed, you could do it yourself. Just look into the files
	doc/bug-mailserver-refcard.txt
	doc/bug-maint-mailcontrol.txt 
from any debian mirror.

---

From: [email-masked]
Date: Wed, 14 Aug 96 12:43 EDT

Thomas>  But they're loaded by irisVxm, the graphical front end:

Which I don't use ..., I use the xmaple shell script (see below).

  Thomas> (Dirk, it might be a good idea to check wether you have something
  Thomas> like this in your environment; another suspect is the XKEYSYMDB
  Thomas> environment variable).

I have no such environment variable set as a design principle of Debian is to
do the Right Thing (TM) without these variables

edd@miles:~> set | grep X
PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:.          

  Thomas> Since I have no idea of how to set an environment variable from a
  Thomas> Debian package (and from which package to do it) I leave it to more
  Thomas> capable hands to reassign this bug to whatever package is right
  Thomas> (xbase, xcompat, or whatever).  

I still believe there is no bug. I see that the iris stuff gets executed if
you say "maple -x" at the prompt. Could you try to use the xmaple script?
That still brings it up as a Motif app but leaves the old .so.3 X11 libraries
out of it.

#!/bin/sh

# Copyright (c) 1993 by Waterloo Maple Software.
# Permission is granted to modify this file to be appropriate for use at the
# installation for which Maple was purchased.

# This script runs Maple V with a Motif interface.

exec maple -x $*

---

From: Thomas Koenig <[email-masked]>
Date: Wed, 14 Aug 1996 19:38:03 +0200 (MET DST)

>Which I don't use ..., I use the xmaple shell script (see below).

I also use xmaple.  xmaple execs "maple -x", which in turn execs
irisVxm, which forks and execs mapleV.

Here's the output of

$ strace -f -e trace=open,execve,uselib,fork,_exit -o ~/xmaple.log xmaple

(and immediately exiting once it's come up).

4201  open("/etc/ld.so.cache", O_RDONLY) = 4
4201  open("/lib/libreadline.so.2.0", O_RDONLY) = 4
4201  open("/lib/libncurses.so.3.0", O_RDONLY) = 4
4201  open("/lib/libc.so.5.2.18", O_RDONLY) = 4
4201  open("/etc/passwd", O_RDONLY)     = 4
4201  open("..", O_RDONLY)              = 4
4201  open("../..", O_RDONLY)           = 4
4201  open("/app/bin/xmaple", O_RDONLY) = 4
4201  execve("/app/bin/maple", ["maple", "-x"], [37 vars]) = 0
4201  open("/etc/ld.so.cache", O_RDONLY) = 4
4201  open("/lib/libreadline.so.2.0", O_RDONLY) = 4
4201  open("/lib/libncurses.so.3.0", O_RDONLY) = 4
4201  open("/lib/libc.so.5.2.18", O_RDONLY) = 4
4201  open("/etc/passwd", O_RDONLY)     = 4
4201  open("..", O_RDONLY)              = 4
4201  open("../..", O_RDONLY)           = 4
4201  open("/app/bin/maple", O_RDONLY)  = 4
4201  execve("/app/maple/bin/irisVxm", ["irisVxm", "-k", "mapleV -b /app/maple/lib/update "], [38 vars]) = 0
4201  uselib("/lib/ld.so")              = 0
4201  open("/etc/ld.so.cache", O_RDONLY) = 4
4201  uselib("/usr/X11R5/lib/libXt.so.3.1.0") = 0
4201  uselib("/usr/X11R5/lib/libX11.so.3.1.0") = 0
4201  uselib("/lib/libc.so.4.6.27")     = 0
4201  open("/etc/host.conf", O_RDONLY)  = 4
4201  open("/etc/resolv.conf", O_RDONLY) = 4
4201  open("/etc/hosts", O_RDONLY)      = 4
4201  open("/home/ig25/.Xauthority", O_RDONLY) = 5
4201  open("/home/ig25/.Xdefaults", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/home/ig25/.Xdefaults-mvmap83", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/home/ig25/.Xdefaults", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.dir", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.alias", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.dir", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.alias", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/app/maple/X11_defaults/MapleV", O_RDONLY) = 5
4201  open("/usr/X386/lib/X11/nls/nls.dir", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.alias", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.dir", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.alias", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.dir", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.alias", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.dir", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.alias", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/app/maple/afm", O_RDONLY)  = 5
4201  open("/usr/X386/lib/X11/XKeysymDB", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/XtErrorDB", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.dir", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.alias", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.dir", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.alias", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.dir", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.alias", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.dir", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  open("/usr/X386/lib/X11/nls/nls.alias", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4201  fork()                            = 4202
4202  execve("/app/maple/bin/mapleV", ["mapleV", "-b", "/app/maple/lib/update", "-b", "/app/maple/lib", "-p", "7,6"], [38 vars]) = 0
4202  uselib("/lib/ld.so")              = 0
4202  open("/etc/ld.so.cache", O_RDONLY) = 4
4202  uselib("/lib/libm.so.4.6.27")     = 0
4202  uselib("/lib/libc.so.4.6.27")     = 0
4202  open("/app/maple/lib/update/sysinit.m", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4202  open("/app/maple/lib/update/maple.ind", O_RDONLY) = 4
4202  open("/app/maple/lib/sysinit.m", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4202  open("/app/maple/lib/maple.ind", O_RDONLY) = 5
4202  open("/app/maple/lib/maple.lib", O_RDONLY) = 4
4202  open("..", O_RDONLY)              = 8
4202  open("../..", O_RDONLY)           = 8
4202  open(".config", O_RDONLY)         = 8
4202  open(".log", O_WRONLY|O_APPEND|O_CREAT, 0666) = -1 ERRNO_30 (Read-only file system)
4202  open("/app/maple/lib/update/src/init", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4202  open("/home/ig25/.mapleinit", O_RDONLY) = 8
4202  open("/home/ig25/.mapleinit", O_RDONLY) = 8
4202  open("/app/maple/lib/update/help.m", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4202  open("/app/maple/lib/update/maple.ind", O_RDONLY) = 5
4202  open("/app/maple/lib/help.m", O_RDONLY) = -1 ERRNO_2 (No such file or directory)
4202  open("/app/maple/lib/maple.ind", O_RDONLY) = 4
4202  open("/app/maple/lib/maple.lib", O_RDONLY) = 5
4202  --- SIGTERM (Terminated) ---
4201  --- SIGCHLD (Child exited) ---
4201  --- SIGALRM (Alarm clock) ---
4201  --- SIGALRM (Alarm clock) ---
4201  --- SIGALRM (Alarm clock) ---
4201  --- SIGALRM (Alarm clock) ---
4201  --- SIGALRM (Alarm clock) ---
4201  _exit(0)                          = ?

>do the Right Thing (TM) without these variables

Could you run the same strace and compare it against mine?

BTW, here are my MD5 checksums of the two libraries in question:

$ md5sum /usr/X11R5/lib/libX11.so.3.1.0 /usr/X11R5/lib/libXt.so.3.1.0 
825a30b219c625a129c8c5f8cb31c6dc  /usr/X11R5/lib/libX11.so.3.1.0
af7caf6f1e84f06f4ec1c53f6ce1147e  /usr/X11R5/lib/libXt.so.3.1.0

If yours differ, this may be a clue.
-- 
Thomas Koenig, [email-masked], [email-masked].
The joy of engineering is to find a straight line on a double
logarithmic diagram.

---

From: [email-masked]
Date: Wed, 14 Aug 96 15:11 EDT

<egg_on_face_mode>

Ahem, I am sorry. I also get the 

[...]
Warning: translation table syntax error: Unknown keysym name: osfDelete
Warning: ... found while parsing '<Key>osfDelete: delete-previous-character()' 

errors which I must have missed before when I started xmaple out of my
.fvwmrc. 

So you're right, one needs the environment variable. I guess the best place
to put it would be /usr/local/bin/xmaple. And could you mail it to me again
as I already deleted our previous mails? 

</egg_on_face_mode>

---

From: Lukas Nellen <[email-masked]>
Date: Wed, 14 Aug 1996 18:02:23 -0500

> >Which I don't use ..., I use the xmaple shell script (see below).
...
> (and immediately exiting once it's come up).
...

I got a strace output similar to yours. My fix to get xmaple up and running 
was to create the following symlinks:
	/usr/X386 -> X11R5
	/usr/X11R5/lib/X11/nls -> ../../../X11R6/lib/X11/nls

			Cheers,
				Lukas

-------------------------------------------------------------------------------
   Dr. Lukas Nellen                 | Email: [email-masked]
   Depto. de Fisica Teorica, IFUNAM |
   Apdo. Postal 20-364              | Tel.:  +52 5 622 5014 ext. 218
   01000 Mexico D.F., MEXICO        | Fax:   +52 5 622 5015

---

From: Thomas Koenig <[email-masked]>
Date: Fri, 16 Aug 1996 11:03:28 +0200 (MET DST)

[email-masked] wrote:

>to put it would be /usr/local/bin/xmaple.

This would certainly fix the specific Maple problem, but I suspect
there may very well be more packages with the same problem.  It's
not Maple - specific; it could bite anything which uses the xcompat
package.

Either setting export XWINHOME=/usr/X11R6 in /etc/profile or
recompiling the old X libraries to use /usr/X11R6 if /usr/X386
isn't there should be the Right Thing.

I'll be reassigning this to the xcompat package, unless there are strong
objections.
-- 
Thomas Koenig, [email-masked], [email-masked].
The joy of engineering is to find a straight line on a double
logarithmic diagram.