[comp.windows.x] X11R4, VGA, Cannot open display

gw18@prism.gatech.EDU (Williams, Greg) (05/27/90)

Well, after much work, I got X11R4 to compile with the vga patches.
When I run xinit, I get the normal background and cursor on the screen.
But, whenever xclock or xterm are started up from the .xinitrc the crash
with the error "Cannot open display".  I've tried explicitly specifying the
display name, and the same problem occurs.  twm does start up without any
problems.  I tried xsetroot, puzzle, and xeyes, and those all work.  I'm
not sure what other clients do and don't work.  Anyone have any hints as
to what the problem may be?  I'm so close to give up now...

roell@lan.informatik.tu-muenchen.dbp.de (Thomas Roell) (05/28/90)

>Well, after much work, I got X11R4 to compile with the vga patches.
>When I run xinit, I get the normal background and cursor on the screen.
>But, whenever xclock or xterm are started up from the .xinitrc the crash
>with the error "Cannot open display".  I've tried explicitly specifying the
>display name, and the same problem occurs.  twm does start up without any
>problems.  I tried xsetroot, puzzle, and xeyes, and those all work.  I'm
>not sure what other clients do and don't work.  Anyone have any hints as
>to what the problem may be?  I'm so close to give up now...

1) xterm: xterm is beeing installed wrong form the Makefile. You will have to
   do 'chmod 755 /usr/bin/x11/xterm'. The same problem arises with xload. 

2) xclock: the problem with xclock is quite deeper. When working with shared
   libs, you cann't reference stically linked routines for this shared lib.
   You have to import this routines indirect via a pointer. That causes a 
   somewhat unusual calling sequence. Look at this example:

	#define sin (* _libXt_sin)()
	extern double sin;

	a = sin (b);

   Now sometimes GCC (I'm using GCC 1.37.1) generates for this sequence the
   wrong code. It tries to call this routine via a register (%eax), but
   doesn't place the correct target for the call in that register before.
   That means some of this indirect calls may fail. I know that even in the
   patches I posted (for USE WITH GCC 1.37.1) are some bad indirect calls. Till
   now I failed to detect all of them. 
   I personally recognized this peculiar bug when trying to bing up 'xclock'
   and 'xbiff'. Perhaps you have the same problems. Check out whether you are
   using GCC 1.37.1 or not using any shared libs (but this is very memory
   wasting).


- Thomas


--
_______________________________________________________________________________
Thomas Roell             Inst. f. Informatik / Technische Universitaet M"unchen
                         Arcisstr. 21 / 8000 Munich 2 / Fed.Rep. of Germany
E-Mail (domain):	 roell@lan.informatik.tu-muenchen.dbp.de
UUCP (when above fails): roell@tumult.{uucp | informatik.tu-muenchen.de}
-------------------------------------------------------------------------------