Bug 9755 - deficiency in handling of stale lock files
Summary: deficiency in handling of stale lock files
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: 7.1 (2006.05)
Hardware: All All
: low normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-24 13:10 UTC by Daniel Drake
Modified: 2018-12-13 22:17 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Daniel Drake 2007-01-24 13:10:19 UTC
xorg-server-1.1.1. Confirmed that the same problem exists in latest git by inspection.

In os/utils.c the LockServer() code has a deficiency when detecting whether a lock file is stale or not.

It reads the PID from the lock file, and if that PID doesn't exist, then the lock file is assumed stale and it is purged. This is fine.

However, if the PID in that file refers to any running process, X assumes the lock is valid and refuses to start the X server.

As process ID's wrap around, it is a legitimate scenario that the PID saved in a stale X lock file eventually ends up referring to a running (non-X) process, and in this case, X refuses to start. It sounds unlikely, but I just saw it happen.

One possible solution for this is to check the process name of the PID referred to in that file, but I don't know of any cross-platform way of doing this (on Linux I think you would have to read it from /proc).
Comment 1 Daniel Stone 2007-02-27 01:35:55 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 2 GitLab Migration User 2018-12-13 22:17:41 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/350.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.