[comp.windows.x] Tek mode gives bus error...

DEG41560@UA1VM.BITNET (Rob Smith) (02/22/90)

Hi,
 I just compiled X11R4 on a VAXstation 2000 with gcc 1.36 under Ultrix 2.2.
At first, everything seemed to work, but xterm gave me the "Not a typewriter"
error, so I remembered that someone else had mentioned this problem and
that the indicated solution was to run the fixincludes script from GNU CC.
I did so. To avoid a total recompile, I went through the ditribution tape and
tried to touch everything that included files that fixincludes had fooled
with. I then recompiled. Everything seems to work now (rather well, too),
except that I cannot get Tek mode in xterm (neither from the menu,
escape sequences (generated by MATLAB), or from a command line option).
WhenI try for Tek mode, I get a Bus Error (nothing more informative than that).
Has anyone else had this problem? Do I need to recompile the whole
distribution? Users around here need Tek Mode for MATLAB, so I've got to
fix it before I convert all the machines to R4.


Thanks,
Rob.

doleh@Bach.CES.CWRU.Edu (Yasser Doleh) (02/23/90)

In article <9002211946.AA14655@ATHENA.MIT.EDU> DEG41560@UA1VM.BITNET (Rob Smith) writes:
>Hi,
>Everything seems to work now (rather well, too),
>except that I cannot get Tek mode in xterm (neither from the menu,
>escape sequences (generated by MATLAB), or from a command line option).
>WhenI try for Tek mode, I get a Bus Error (nothing more informative than that).
>Has anyone else had this problem? Do I need to recompile the whole
>distribution? Users around here need Tek Mode for MATLAB, so I've got to
>fix it before I convert all the machines to R4.

	We had the same problem. In the file Tekproc.c around line
1289 there is the following code:

    if (tw->tek.initial_font) {
	    char *s = tw->tek.initial_font;
		    
	    XmuCopyISOLatin1Lowered (s, s);

The function XmuCopyISOLatin1Lowered tries to modify the string s which 
has a default value the constant s. gcc make all string constants read only.
This is where xterm fail. To solve the problem:

1 - compile Tekproc.c using gcc -fwritable-strings
2 - modify Tekproc such that the you pass an array to XmuCopyISOLatin1Lowered
	instead of the string constant.

3 - A temprory solution will be in /usr/lib/X11/app-defaults/XTerm
	put the following line 

	*tek4014*initialFont:   large

	which make the value on s above a variable not the default string
	constant.

I did not know which is better ? modify the Imakefile to compile Tekproc
with -fwritable-strings ? or modify Tekproc.c ? What the xperts say about
that ?

Thanks
doleh@math-cs.kent.edu