Skip to content

Conversation

stefan11111
Copy link
Contributor

Opening this again.
@metux You said we could to this in another place, can you explain more?

stefan11111 and others added 3 commits September 11, 2025 13:11
This commit removes a function that will be used in another commit

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit removes a macro that will be used in a future commit

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
In most typical Linux X servers (like Xvfb, Xephyr, or Xwayland),
no child process outlives the server, so this issue rarely arises.

However, in embedded X servers (based on Xvfb or Kdrive) or in custom Xorg modules,
the server might launch a long-running command with regular fork+exec calls.

If the X server crashes or exits while that command is still running
(for example, it spawns a tombstone generator or any process that hangs or turns to zombie),
the file descriptor associated with the abstract socket can remain open in the child process.

This leads to the kernel refusing to allow another X server
to bind the same socket until the child process terminates
(because there is no explicit way to unlink abstract socket, unlike Unix socket).

By marking the file descriptor as close-on-exec,
we ensure it is automatically closed in child processes,
preserving the ability of a new X server process to bind the socket immediately.

Signed-off-by: Twaik Yont <9674930+twaik@users.noreply.github.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1906>
@metux
Copy link
Contributor

metux commented Sep 11, 2025

what is the specific use case ? where exactly could fd's be leaked ?

@metux
Copy link
Contributor

metux commented Sep 26, 2025

ping @stefan11111

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.

3 participants