Ticket #416 (closed usability: fixed)

Opened 3 years ago

Last modified 2 years ago

Race condition on X startup

Reported by: cobbe@… Owned by: jeremyhu@…
Priority: Nice to Have Milestone: 2.6.2
Component: xserver Version: 2.5.0 (xserver-1.7.6)
Keywords: Cc:

Description

I typically start XQuartz by means of a login item, a program that I wrote myself (in C) which establishes certain environment settings and then execs /opt/X11/bin/xterm. This pokes the launchd socket and starts the X server as expected. I also have a file ~/.xinitrc.d/00-resources.sh, which is executable, that calls "/opt/X11/bin/xrdb ~/.Xresources" in the foreground.

There's a race condition between these two programs on X startup. Sometimes the xterm starts first, sometimes the resources get loaded (as demonstrated by the fact that the xterm respects the resource settings only sometimes). I know that the resources are always loaded, because in cases where the xterm starts first, I can type "xterm" at its prompt and get a new xterm that does respect the resource settings.

Additional details available upon request, including the source code of the program that starts xterm.

Change History

comment:1 Changed 3 years ago by cobbe@…

Forgot to mention -- I observed this bug running XQuarts 2.5.1_rc1, not 2.5.0.

comment:2 Changed 3 years ago by jeremyhu@…

  • Status changed from new to assigned
  • Milestone set to 2.6.0

comment:3 Changed 2 years ago by jeremyhu@…

  • Milestone changed from 2.6.0 to 2.6.1

comment:4 Changed 2 years ago by jeremyhu@…

  • Milestone changed from 2.6.1 to 2.6.2

comment:5 Changed 2 years ago by jeremyhu@…

This should be "fixed" in 2.6.2_rc1 when it is released. We now wait 3 seconds for xinitrc to finish before accepting connections from the launchd FD.

comment:6 Changed 2 years ago by jeremyhu@…

  • Status changed from assigned to closed
  • Resolution set to fixed

comment:7 Changed 2 years ago by jeremyhu@…

(yes, it just biases the race in xinitrc's favor, so this isn't technically "fixed", but it's good enough for now)

Note: See TracTickets for help on using tickets.