Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[regression] code to open local display in waitforx is broken by recent libxcb #3336

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

matt335672
Copy link
Member

Thanks to @derekschrock for raising this as a comment to #3297

Commit 80fab03 introduced a way to prevent waitforx going to the network when trying to open a display, and hence potentially blocking.

This method turned out to be invalidated by libxcb version 1.16 and 1.17

This change adds an explicit check that the Unix socket for the display in /tmp/.X11-unix/Xn is open before trying to connect to display ':n'. This has the same effect.

In the original change I was keen to avoid a dependency on the string "/tmp/.X11-unix/X%d" for converting a display number to a unix socket. This was unjustified, as many other utilities assume this string, including ssh:-

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.5 LTS
Release:	22.04
Codename:	jammy
$  strings $(which ssh) | grep X11-unix
/tmp/.X11-unix/X%u

Commit 80fab03 introduced a way to
prevent waitforx going to the network when trying to open a display,
and hence potentially blocking.

This method turned out to be invalidated by libxcb version 1.16 and
1.17

This change adds an explicit check that the Unix socket for the display
in /tmp/.X11-unix/Xn is open before trying to connect to display ':n'.
This has the same effect.
@matt335672 matt335672 mentioned this pull request Dec 11, 2024
@matt335672
Copy link
Member Author

I'm going to merge this now as it fixes an existing problem in the devel branch and it's been informally tested already by @derekschrock

@matt335672 matt335672 merged commit 83cf04b into neutrinolabs:devel Dec 12, 2024
14 checks passed
@matt335672 matt335672 deleted the fix_x11_socket_check branch December 12, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant