Opened 20 years ago

Closed 18 years ago

#1642 closed defect (fixed)

BUG: XFree86 and XDarwin.app fail to run for users using csh and tcsh. There is an easy fix which needs to be prominently posted for Darwin Ports users.

Reported by: cwneville@… Owned by: ssen@…
Priority: Normal Milestone:
Component: ports Version: 1.0
Keywords: Cc:
Port:

Description

As distributed in the Darwin Port, XFree86, and XDarwin.app which is included in the XFree86 port, cannot start X-Windows sessions using the startx command from a terminal, or by double-clicking XDarwin.app, for users using csh or tcsh. (Ksh and bash were not tested).

Both failures are due to the debugging pragmas left by gcc at the top of the shell scripts in the files /usr/X11R6/bin/startx and /Applications/XDarwin.app/Contents/Resources/startXClients. This is a known bug in XFree86 4.3.0 (see, for example, http://www.xdarwin.org/), but people don't seem to have said much about it until the pre-release version of XFree86 4.4.0 became available. (And I tore my hair out before diagnosing the cause myself.) The solution is to post- process these scripts in the port to remove the pragmas, or to PROMINENTLY inform Darwin Ports users to do this and tell them how (see item 4 under "Additonal Comments").

Solution:

After removing the pragmas from the two scripts (and fixing the path - see item 2 below) XFree86 works beautifully under tcsh. It works when the startx command is issued from a terminal, and it works when XDarwin.app is double-clicked. So the solution is to remove the pragmas at the top of both script files.

Additonal Comments:

  1. As XFree86 4.4.0 promises to fix the pragma bug, it might be best to wait for the production

version of 4.4.0 and not to alter the Darwin portfile. In this case the user needs to be told PROMINENTLY how to remove the pragmas by hand.

  1. /usr/X11R6/bin is often not in the user's path before installing XFree86, so the user also needs

to be PROMINENTLY informed that this must be added to the path in /etc/csh.login and /etc/ profile (or in .login and .profile in the user's home directory). It is hard to do this with TextEdit, so users need to be given clear instructions how (see item 4 below).

  1. When the path is fixed but before the pragmas are removed, XFree86 exhibits some weird

behavior. Here are two examples:

  1. The startx command doesn't work, but the more primitive xinit /etc/X11/xinit/xinitrc

command works fine. This can be used as a (not very satisfactory) work-around.

  1. Typing sudo startx works fine, except that all X-apps are run as root, which is VERY VERY

dangerous.

  1. Detailed user instructions for fixing things by hand are included below. These may be useful for

whomever is selected to write up user instructions:

How to Fix It:

You have to do all this stuff from a terminal, except for the editing parts if you like to use

TextEdit. (If you use TextEdit, BE SURE TO SAVE ALL EDITED FILES as plain text, NOT RTF!!!)

  1. Add /usr/X11R6/bin to the path in /etc/csh.login and /etc/profile so it will be available to ALL

users. (If you use bash, maybe you will have to do the same for /etc/bashrc. Try it without, and then with if need be.)

To do this, you have to edit the csh.login and profile files to do this. If you have never done

this with system files before, follow the steps outlined in (2) and (3) immediately below.

  1. Make a working directory, say XDarwinStuff, where ever you like to work. For best results, be

sure XDarwinStuff is located somewhere convenient in your home directory tree.

  1. Even though it doesn't break the script, the pragma also occurs at the top of the xinitrc file in /

etc/X11/xinit, and it really shouldn't be there. So copy the xinitrc file to XDarwinStuff, and edit to in your favorite editor, say emacs, pico, vi, or TextEdit, to remove the pragma line. (If you use TextEdit, BE SURE TO SAVE ALL EDITED FILES as plain text, NOT RTF!!!)

For safety, rename (move) the original xinitrc file in /etc/X11/xinit to xinitrc.original, and then

copy the edited file back to /etc/X11/xinit.

  1. Copy the startx file in /usr/X11R6/bin to XDarwinStuff and repeat the steps given in (3) above

for startx.

  1. Copy the startXClients file in /Applications/XDarwin.app/Contents/Resources to XDarwinStuff

and repeat the steps given in (3) above for startXClients.

  1. Test everything to see if it all works.

Detailed Instrutions:

Here are step-by-step instructions given as (slightly edited) transcriptions of terminal sessions.

It is easiest to use TWO terminals placed side-by-side for easy viewing. Terminal 1 is for what goes on in the XDarwinStuff directory, and terminal 2 is for what goes on in /etc/X11/xinit, /usr/ X11R6/bin, and /Applications/XDarwin.app/Contents/Resources directories.


  1. This is the create directory and copy phase. We assume your user name is "you" -- yeah! it's

unlikely, but it gets the point across. We also assume like to keep all your work in a subdirectory of your home directory named Stuff.

Terminal 1

[YourMachine:~] you% cd Stuff/ [YourMachine:~/Stuff] you% mkdir XDarwinStuff [YourMachine:~/Stuff] you% cd XDarwinStuff [YourMachine:~/Stuff/XDarwinStuff] you% ls -al total 0 drwxr-xr-x 2 you staff 68 Feb 18 23:22 . drwxr-xr-x 50 you staff 1700 Feb 18 22:44 .. [YourMachine:~/Stuff/XDarwinStuff] you% pwd /Users/you/Stuff/XDarwinStuff

Terminal 2

[YourMachine:~] you% cd /etc/X11/xinit [YourMachine:/etc/X11/xinit] you% ls -al total 8 drwxr-xr-x 3 root admin 102 Feb 17 03:06 . drwxr-xr-x 13 root wheel 442 Feb 17 03:13 .. -r--r--r-- 1 root admin 766 Feb 17 03:06 xinitrc [YourMachine:/etc/X11/xinit] you% cp xinitrc /Users/you/Stuff/XDarwinStuff/xinitrcNew

YourMachine:/etc/X11/xinit] you% cd /usr/X11R6/bin [YourMachine:/usr/X11R6/bin] you% ls -al total 36984

. . .

-rwxr-xr-x 1 root admin 27484 Feb 17 03:06 smproxy -rwxr-xr-x 1 root admin 2646 Feb 17 13:06 startx -rwxr-xr-x 1 root admin 21648 Feb 17 03:06 sxpm

. . .

[YourMachine:/usr/X11R6/bin] you% cp startx /Users/you/Stuff/XDarwinStuff/startxNew

cd /Applications/XDarwin.app/Contents/Resources [YourMachine:XDarwin.app/Contents/Resources] you% ls -al total 80

. . .

dr-xr-xr-x 3 root staff 102 Feb 17 03:12 glxMesa.bundle dr-xr-xr-x 7 root staff 238 Feb 17 03:12 ko.lproj -rwxr-xr-x 1 root staff 565 Feb 17 03:12 startXClients [YourMachine:XDarwin.app/Contents/Resources] you% cp startXClients /Users/you/Stuff/ XDarwinStuff/startXClientsNew


  1. This is the editing phase.

Edit the files in XDarwinStuff.


  1. This is the rename and copy back phase.

Terminal 1

[YourMachine:~/Stuff/XDarwinStuff] you% ls -al total 56 drwxr-xr-x 9 you staff 306 Feb 18 22:06 . drwxr-xr-x 5 you staff 170 Feb 18 21:12 .. -rwxr-xr-x 1 you staff 6148 Feb 18 22:02 .DS_Store -rwxr-xr-x 1 you staff 565 Feb 18 22:06 startXClientsNew -rwxr-xr-x 1 you staff 2646 Feb 18 22:01 startxNew -rw-r--r-- 1 you staff 789 Feb 18 21:56 xinitrcNew [YourMachine:~/Stuff/XDarwinStuff] you% pwd /Users/you/Stuff/XDarwinStuff

Terminal 2

[YourMachine:~] you% cd /etc/X11/xinit [YourMachine:/etc/X11/xinit] you% ls -al total 8 drwxr-xr-x 3 root admin 102 Feb 17 03:06 . drwxr-xr-x 13 root wheel 442 Feb 17 03:13 .. -r--r--r-- 1 root admin 766 Feb 17 03:06 xinitrc [YourMachine:/etc/X11/xinit] you% sudo mv xinitrc xinitrc.original Password: [YourMachine:/etc/X11/xinit] you% ls -al total 8 drwxr-xr-x 3 root admin 102 Feb 18 22:09 . drwxr-xr-x 13 root wheel 442 Feb 17 03:13 .. -r--r--r-- 1 root admin 766 Feb 17 03:06 xinitrc.original [YourMachine:/etc/X11/xinit] you% sudo cp /Users/you/Stuff/XDarwinStuff/xinitrcNew xinitrc [YourMachine:/etc/X11/xinit] you% ls -al total 16 drwxr-xr-x 4 root admin 136 Feb 18 22:11 . drwxr-xr-x 13 root wheel 442 Feb 17 03:13 .. -rw-r--r-- 1 root admin 789 Feb 18 22:11 xinitrc -r--r--r-- 1 root admin 766 Feb 17 03:06 xinitrc.original [YourMachine:/etc/X11/xinit] you% sudo chmod 444 xinitrc [YourMachine:/etc/X11/xinit] you% ls -al total 16 drwxr-xr-x 4 root admin 136 Feb 18 22:11 . drwxr-xr-x 13 root wheel 442 Feb 17 03:13 .. -r--r--r-- 1 root admin 789 Feb 18 22:11 xinitrc -r--r--r-- 1 root admin 766 Feb 17 03:06 xinitrc.original

[YourMachine:/etc/X11/xinit] you% cd /usr/X11R6/bin [YourMachine:/usr/X11R6/bin] you% ls -al total 36984

. . .

-rwxr-xr-x 1 root admin 27484 Feb 17 03:06 smproxy -rwxr-xr-x 1 root admin 2646 Feb 17 13:06 startx -rwxr-xr-x 1 root admin 21648 Feb 17 03:06 sxpm

. . .

[YourMachine:/usr/X11R6/bin] you% sudo mv startx startx.original [YourMachine:/usr/X11R6/bin] you% ls -al total 36984

. . .

-rwxr-xr-x 1 root admin 27484 Feb 17 03:06 smproxy -rwxr-xr-x 1 root admin 2748 Feb 17 03:06 startx.original -rwxr-xr-x 1 root admin 21648 Feb 17 03:06 sxpm

. . .

[YourMachine:/usr/X11R6/bin] you% sudo cp /Users/you/Stuff/XDarwinStuff/startxNew startx [YourMachine:/usr/X11R6/bin] you% ls -al total 36992

. . .

-rwxr-xr-x 1 root admin 27484 Feb 17 03:06 smproxy -rwxr-xr-x 1 root admin 2744 Feb 18 22:40 startx -rwxr-xr-x 1 root admin 2748 Feb 17 03:06 startx.original -rwxr-xr-x 1 root admin 21648 Feb 17 03:06 sxpm

. . .

cd /Applications/XDarwin.app/Contents/Resources [YourMachine:XDarwin.app/Contents/Resources] you% ls -al total 80

. . .

dr-xr-xr-x 3 root staff 102 Feb 17 03:12 glxMesa.bundle dr-xr-xr-x 7 root staff 238 Feb 17 03:12 ko.lproj -rwxr-xr-x 1 root staff 565 Feb 17 03:12 startXClients [YourMachine:XDarwin.app/Contents/Resources] you% sudo mv startXClients startXClients.original [YourMachine:XDarwin.app/Contents/Resources] you% ls -al total 80

. . .

dr-xr-xr-x 3 root staff 102 Feb 17 03:12 glxMesa.bundle dr-xr-xr-x 7 root staff 238 Feb 17 03:12 ko.lproj -r-xr-xr-x 1 root staff 686 Feb 17 03:12 startXClients.original [YourMachine:XDarwin.app/Contents/Resources] you% sudo cp /Users/you/Stuff/XDarwinStuff/ startXClientsNew startXClients [YourMachine:XDarwin.app/Contents/Resources] you% ls -al total 88

. . .

dr-xr-xr-x 3 root staff 102 Feb 17 03:12 glxMesa.bundle dr-xr-xr-x 7 root staff 238 Feb 17 03:12 ko.lproj -rwxr-xr-x 1 root staff 663 Feb 18 23:01 startXClients -r-xr-xr-x 1 root staff 686 Feb 17 03:12 startXClients.original [YourMachine:XDarwin.app/Contents/Resources] you% sudo chmod 555 startXClients [YourMachine:XDarwin.app/Contents/Resources] you% ls -al total 88

. . .

dr-xr-xr-x 3 root staff 102 Feb 17 03:12 glxMesa.bundle dr-xr-xr-x 7 root staff 238 Feb 17 03:12 ko.lproj -r-xr-xr-x 1 root staff 663 Feb 18 23:01 startXClients -r-xr-xr-x 1 root staff 686 Feb 17 03:12 startXClients.original


  1. This is the test everything phase.

Invoke xinit from the terminal, just to see if X-Windows comes up. (It probably won't come up

in a very useable form.) Shut down XDarwin.

Invoke startx from the terminal to see if X-Windows comes up in a useable form. You should

be able to do stuff like move terminal windows around. Shut down XDarwin.

Double-click on XDarwin.app to see if X-Windows comes up. Try moving windows around. Try

starting an X-app like xman from one of the terminal windows. Shut down XDarwin.

Change History (4)

comment:1 Changed 20 years ago by olegb@…

Owner: changed from darwinports-bugs@… to ssen@…

assigning to maintainer

comment:2 Changed 19 years ago by snu@…

Summary: XFree86 and XDarwin.app fail to run for users using csh and tcsh. There is an easy fix which needs to be prominently posted for Darwin Ports users.BUG: XFree86 and XDarwin.app fail to run for users using csh and tcsh. There is an easy fix which needs to be prominently posted for Darwin Ports users.

comment:3 Changed 19 years ago by mww@…

is this bug resolved by the update to 4.5.0?

comment:4 Changed 18 years ago by markd@…

Resolution: fixed
Status: newclosed

We can retire this one. Even though XFree is broken, the revision is at 4.5 so bugs in 4.3 were fixed upstream.

Note: See TracTickets for help on using tickets.