Bug 19382 - xdg-screensaver: Race in suspend/resume can lead to process leak
Summary: xdg-screensaver: Race in suspend/resume can lead to process leak
Status: RESOLVED FIXED
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: 1.0
Hardware: Other All
: medium normal
Assignee: Fathi Boudra
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-03 15:08 UTC by Ben Hutchings
Modified: 2009-08-10 02:29 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
proposed fix (477 bytes, patch)
2009-01-03 15:08 UTC, Ben Hutchings
Details | Splinter Review

Description Ben Hutchings 2009-01-03 15:08:52 UTC
Created attachment 21646 [details] [review]
proposed fix

In xdg-screensaver, do_resume() and track_window() both call
cleanup_suspend() to remove the tracking process from the status file.
cleanup_suspend() removes the process using a grep -v for the window
id.  This means there is a race condition after the first removal
where a new tracking process can be created and then removed from the
status file while it's still active.

I think this can be fixed by either (1) looking for the process id
in the status file or (2) removing one of the
calls to cleanup_suspend().

The attached patch does (1).
Comment 1 Fathi Boudra 2009-07-26 10:15:28 UTC
Fixed in CVS.


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.