Problem with launching x11 applications

Joined
May 4, 2009
Messages
21
Reaction score
0
Points
1
Your Mac's Specs
Model: Macbook; Processor: Intel Core 2 Duo (2.4GHz); RAM: 2GB (DDR3); Video memory: 256MB
Let me try to explain my problem as best as I can. Please bear with me and let me know what other information I need to provide to troubleshoot this.

Machine description:
Macbook 13.3", Mac OSX 10.5.8, Darwin Kernel Version 9.8.0

Problem description:
It all started when darwinport failed to install kdegames4 (and my efforts thereafter to get that installed!). I can no longer launch any x11 applications --e.g., xterm, xpdf, xdvi, inkscape, molden, gnuplot with x11. After the problem had started, if I tried to start any of these, the X icon would begin bouncing in the dock and go away just to come back a few seconds later --- this would keep going on and on --- even if I tried to kill them by finding them in the terminal. Whenever I moused-over the X icon on the dock it would just freeze everything --- and I had to kill the dock to get my computer responding again (luckily I could use spotlight and terminal to get this done). Before this problem, everything used to work flawlessly.

Disgusted, I installed the Xquartz from
XQuartz
but that did not help me much. The same problem comes back while launching (by directly clicking or from terminal) any x11 application, only this time it does not cause everything to freeze up when I mouse over the bouncing X icon.

Funny that I can access x11 applications from another account on the same machine. This is why I believe that the X11 installation on my machine is OK and it's an OSX specific problem caused by messing up some config files on the problematic account.

I didn't find any reasonable differences between the settings in the two accounts -- except for the fact that the problematic account is my main account and it has lots of other applications installed. Grrrrrrrrrr!


Now it's time for some output:
Code:
18:05:57 [438]$ echo $DISPLAY
/tmp/launch-Cy3Z7G/:0


Result of running startx:
Code:
font_cache: Updating FC cache
xauth:  creating new authority file /Users/kousik/.serverauth.13609
xauth: (argv):1:  bad display name "kousiks-apple:1" in "list" command
xauth: (stdin):1:  bad display name "kousiks-apple:1" in "add" command

font_cache: Done

waiting for X server to begin accepting connections .
..
..

Then it puts dots for a while and at the end says:
Code:
..Quitting Xquartz...
Xquartz: start_x11_server: (ipc/send) invalid destination port

giving up.
/usr/X11/bin/xinit:  Connection refused (errno 61):  unable to connect to X server
/usr/X11/bin/xinit:  No such process (errno 3):  unexpected signal 2.
xauth: (argv):1:  bad display name "kousiks-apple:1" in "remove" command


Trying it again gives:
Code:
font_cache: Scanning user font directories to generate X11 font caches
font_cache: Updating FC cache
xauth:  creating new authority file /Users/kousik/.serverauth.20610
xauth: (argv):1:  bad display name "kousiks-apple:1" in "list" command
xauth: (stdin):1:  bad display name "kousiks-apple:1" in "add" command

Xquartz: X11.app = /Applications/Utilities/X11.app/Contents/MacOS/X11
Xquartz: Starting X server: /Applications/Utilities/X11.app/Contents/MacOS/X11 --listenonly
/opt/local/bin:/opt/local/sbin:/Users/kousik/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/X11R6/bin
X11.app: main(): argc=2
        argv[0] = /Applications/Utilities/X11.app/Contents/MacOS/X11.bin
        argv[1] = --listenonly
Waiting for startup parameters via Mach IPC.
X11.app: do_start_x11_server(): argc=6
        argv[0] = /usr/X11/bin/X
        argv[1] = :1
        argv[2] = -nolisten
        argv[3] = tcp
        argv[4] = -auth
        argv[5] = /Users/kousik/.serverauth.20610

Fatal server error:
Server is already active for display 1
        If this server is no longer running, remove /tmp/.X1-lock
        and start again.

   AbortDDX
Quitting Xquartz...
Xquartz: start_x11_server: (ipc/mig) server died
font_cache: Done
giving up.
/usr/X11/bin/xinit:  Connection refused (errno 61):  unable to connect to X server
/usr/X11/bin/xinit:  No such process (errno 3):  Server error.
xauth: (argv):1:  bad display name "kousiks-apple:1" in "remove" command

Looks like it's setting the DISPLAY to localhost:1 ("kousiks-apple" is the hostname). But I don't see where and how since the output of "echo $DISPLAY" is the same as above!

It spits out the PATH variable at the top because I put "echo $PATH" in the script /Applications/Utilities/X11.app/Contents/MacOS/X11.

I followed the instructions on this page
Leopard and X11
but that too did not help me.


Output of running xinit
Code:
Xquartz: X11.app = /Applications/Utilities/X11.app/Contents/MacOS/X11
Xquartz: Starting X server: /Applications/Utilities/X11.app/Contents/MacOS/X11 --listenonly
/opt/local/bin:/opt/local/sbin:/Users/kousik/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin
X11.app: main(): argc=2
        argv[0] = /Applications/Utilities/X11.app/Contents/MacOS/X11.bin
        argv[1] = --listenonly
Waiting for startup parameters via Mach IPC.
X11.app: do_start_x11_server(): argc=2
        argv[0] = X
        argv[1] = :0
Xquartz starting:
X.Org X Server 1.5.3-apple14
Build Date: 20090812
(EE) XKB: Couldn't open rules file /usr/X11/share/X11/xkb/rules/base
(EE) XKB: No components provided for device Virtual core keyboard
(EE) XKB: Couldn't open rules file /usr/X11/share/X11/xkb/rules/base
(EE) XKB: No components provided for device keyboard

waiting for X server to shut down

I installed the package xkeyboard-config-1.7 to fix the problem with xkb as told somewhere else -- without any visible effect.


In the following link you can find a snapshot of my ~/Library/Prefereces/org.x.X11.plist file
Picasa Web Albums - kousik - Technical

Please please pleeeeease............. help me solve this problem!
 
OP
K
Joined
May 4, 2009
Messages
21
Reaction score
0
Points
1
Your Mac's Specs
Model: Macbook; Processor: Intel Core 2 Duo (2.4GHz); RAM: 2GB (DDR3); Video memory: 256MB
Nobody had this problem before?
Please help me fix this problem.... I'll reaaaaaaaaaaaaally appreciate your help. Thanks!
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
I looked at the content of my DISPLAY variable and looked similar to yours. If you run xterm from your terminal window what happens?
 
OP
K
Joined
May 4, 2009
Messages
21
Reaction score
0
Points
1
Your Mac's Specs
Model: Macbook; Processor: Intel Core 2 Duo (2.4GHz); RAM: 2GB (DDR3); Video memory: 256MB
I looked at the content of my DISPLAY variable and looked similar to yours. If you run xterm from your terminal window what happens?

Thanks for the reply.

However, when I try to run xterm (or /usr/X11/bin/xterm) in the terminal (i.e., terminal.app) it does not launch xterm at all; only the X icon on the doc comes and goes away repeatedly -- just like any other x11-based application behaving nowadays on this account.

As I mentioned earlier, when I try to run ANY x11 application in another account on the SAME machine it runs perfectly fine!
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Code:
If this server is no longer running, remove /tmp/.X1-lock
        and start again.

Have you looked in your /tmp folder to see if there's a lock file?
After a crash, X11 wont start if the lock file is still there.
 
OP
K
Joined
May 4, 2009
Messages
21
Reaction score
0
Points
1
Your Mac's Specs
Model: Macbook; Processor: Intel Core 2 Duo (2.4GHz); RAM: 2GB (DDR3); Video memory: 256MB
Code:
If this server is no longer running, remove /tmp/.X1-lock
        and start again.

Have you looked in your /tmp folder to see if there's a lock file?
After a crash, X11 wont start if the lock file is still there.

Well, there were two files: .X1-lock and .X0-lock in /tmp. I first removed the first one, and tried to run xterm in the terminal --- the same problem persisted (i.e, xterm did not start and only the X icon kept coming back in the dock). Most importantly, it did not recreate the lock file!!!

I deleted the other file, .X0-lock too --- and I saw no effect and neither was this lock file recreated when I tried to run xterm again.

[From my other account (where X11 apps still run flawlessly) on the same machine, I can see that if I launch xterm, it creates .X0-lock in /tmp. Now it makes me wonder what actually created .X1-lock in the first place!!! Well, for the time being, I am happy with it assuming some other X11 app did that!]

Thanks for your reply!
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
I believe each user running X11 creates it's own lock file for that session.
If the session exits cleanly, the lock file is deleted (or should be).
Are you using your own .xinit file or the systems? Have you edited the system .xinit file in any way?
Have you tried any other window manager like windowmaker (just fishing here)?
What happens if you run X11 from /Applications/Utilities by double clicking on it?
Take a look here and see if anything helps (it's a little old, but usefull):
Sao's Place - Fink & Apple's X11
 
OP
K
Joined
May 4, 2009
Messages
21
Reaction score
0
Points
1
Your Mac's Specs
Model: Macbook; Processor: Intel Core 2 Duo (2.4GHz); RAM: 2GB (DDR3); Video memory: 256MB
Are you using your own .xinit file or the systems? Have you edited the system .xinit file in any way?

Can you believe that I had this line in ~/.xinitrc and I pretended not seeing it?
Code:
/sw/bin/startkde 2>&1
It must have gotten there while I was trying to install kdegames as I mentioned in my first post, and KDE (which was never installed properly) was supposed to be invoked by it.

I feel like kicking myself ---- after all, it was the first thing I should have noticed!

I manually removed the file, ~/.xinitrc, and everything now works fine.

Thank you all for your help.
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
It's the little things that mess you up :)
Glad you got it working.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top