robert delius royar <x11@frinabulax.org> writes:
You asked others to supply the reults of grepping system.log for DISPLAY. Here, are my results of that (I think the erroneous perios are 15:XX times: Apr 23 08:33:58 grendal [0x0-0x13013].org.macosforge.xquartz.X11[182]: X11.app: Received new $DISPLAY fd: 5 ... sleeping to allow xinitrc to catchup.
I've been poking at this too, and I concur that system.log isn't showing any clear difference between 2.5.0 and 2.5.1_beta2. I notice that the "Received new $DISPLAY" log entry seems to be happening asynchronously relative to the other output from the server, eg compare these sequences: Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: X11.app: main(): argc=2 Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: argv[0] = /Applications/Utilities/XQuartz.app/Contents/MacOS/X11.bin Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: argv[1] = -psn_0_258111 Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: Waiting for startup parameters via Mach IPC. Apr 23 18:02:46 pro org.macosforge.xquartz.startx[1596]: font_cache: Scanning user font directories to generate X11 font caches Apr 23 18:02:46 pro org.macosforge.xquartz.startx[1596]: font_cache: Updating FC cache Apr 23 18:02:46 pro org.macosforge.xquartz.privileged_startx[1295]: font_cache: Scanning system font directories to generate X11 font caches Apr 23 18:02:46 pro defaults[1624]: \nThe domain/default pair of (org.macosforge.xquartz.X11, dpi) does not exist Apr 23 18:02:46 pro org.macosforge.xquartz.startx[1596]: xauth: creating new authority file /Users/tgl/.serverauth.1596 Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: X11.app: Listening on socket for fd handoff: (4) /var/tmp/tmp.0.ummUPf Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: X11.app: Thread created for handoff. Returning success to tell caller to connect and push the fd. Apr 23 18:02:46 pro org.macosforge.xquartz.startx[1596]: Xquartz: Handoff connection established (try 1 of 5) on fd 6, "/var/tmp/tmp.0.ummUPf". Sending message. Apr 23 18:02:46 pro org.macosforge.xquartz.startx[1596]: Xquartz: Message sent. Closing handoff fd. Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: X11.app: Received new $DISPLAY fd: 6 ... sleeping to allow xinitrc to catchup. Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: X11.app: do_start_x11_server(): argc=6 Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: argv[0] = /opt/X11/bin/X Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: argv[1] = :5 Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: argv[2] = -nolisten Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: argv[3] = tcp Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: argv[4] = -auth Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: argv[5] = /Users/tgl/.serverauth.1596 Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: Xquartz starting: Apr 23 18:02:46 pro [0x0-0x3f03f].org.macosforge.xquartz.X11[1588]: X.Org X Server 1.8.0 Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: X11.app: main(): argc=2 Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: argv[0] = /Applications/Utilities/XQuartz.app/Contents/MacOS/X11.bin Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: argv[1] = -psn_0_294984 Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: Waiting for startup parameters via Mach IPC. Apr 23 18:04:27 pro org.macosforge.xquartz.startx[1858]: font_cache: Scanning user font directories to generate X11 font caches Apr 23 18:04:27 pro org.macosforge.xquartz.startx[1858]: font_cache: Updating FC cache Apr 23 18:04:27 pro org.macosforge.xquartz.privileged_startx[1295]: font_cache: Scanning system font directories to generate X11 font caches Apr 23 18:04:27 pro defaults[1886]: \nThe domain/default pair of (org.macosforge.xquartz.X11, dpi) does not exist Apr 23 18:04:27 pro org.macosforge.xquartz.startx[1858]: xauth: creating new authority file /Users/tgl/.serverauth.1858 Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: X11.app: Listening on socket for fd handoff: (4) /var/tmp/tmp.0.9631Cf Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: X11.app: Thread created for handoff. Returning success to tell caller to connect and push the fd. Apr 23 18:04:27 pro org.macosforge.xquartz.startx[1858]: Xquartz: Handoff connection established (try 1 of 5) on fd 6, "/var/tmp/tmp.0.9631Cf". Sending message. Apr 23 18:04:27 pro org.macosforge.xquartz.startx[1858]: Xquartz: Message sent. Closing handoff fd. Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: X11.app: do_start_x11_server(): argc=6 Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: argv[0] = /opt/X11/bin/X Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: argv[1] = :6 Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: X11.app: Received new $DISPLAY fd: 6 ... sleeping to allow xinitrc to catchup. Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: argv[2] = -nolisten Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: argv[3] = tcp Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: argv[4] = -auth Apr 23 18:04:27 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: argv[5] = /Users/tgl/.serverauth.1858 Apr 23 18:04:27 pro org.macosforge.xquartz.privileged_startx[1295]: font_cache: Updating FC cache Apr 23 18:04:28 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: Xquartz starting: Apr 23 18:04:28 pro [0x0-0x48048].org.macosforge.xquartz.X11[1848]: X.Org X Server 1.7.6 At first I thought that was a smoking gun, but looking further back in system.log I see that in both versions that entry can happen before, during, or after the dump of the argv values. Is that expected? Maybe there's some race condition here. Some other random experimentation: * If I launch Terminal then "echo $DISPLAY" shows the correct value (with full path), even while shells inside xterms show the wrong value. In fact, I can launch an xterm *from the Terminal shell* ("xterm &") and its shell still shows the wrong value. * I thought from the above that maybe xterm itself was incorrectly editorializing on the DISPLAY value it inherited. I tried reinserting 2.5.0's /opt/X11/bin/xterm into a 2.5.1_beta2 installation, but this did not fix it. It is clear that something is changing the inherited value of DISPLAY but it's not in the xterm executable --- maybe somewhere in the X libraries? regards, tom lane