Bug 12740 - Should release device locks when locking application quits
Summary: Should release device locks when locking application quits
Status: RESOLVED FIXED
Alias: None
Product: hal
Classification: Unclassified
Component: hald (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Danny Kukawka
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-08 11:08 UTC by Ross Burton
Modified: 2008-10-20 02:01 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch to fix the problem (602 bytes, patch)
2008-08-11 09:20 UTC, Danny Kukawka
Details | Splinter Review
new patch version (817 bytes, patch)
2008-08-11 09:25 UTC, Danny Kukawka
Details | Splinter Review

Description Ross Burton 2007-10-08 11:08:06 UTC
(see gnome bugzilla #484535 for more)

If Sound Juicer locks the CD-ROM device when it starts ripping, and then crashes, the device remains locked.  HAL should track the lifecycle of the application which requested the lock, and release it when that application disconnects from the bus on the assumption that it neglected to unlock for whatever reason.
Comment 1 Danny Kukawka 2008-08-11 09:20:38 UTC
Created attachment 18218 [details] [review]
Patch to fix the problem

I can't find out which HAL version you use, but the attached patch should fix the problem with HAL 0.5.11 or git master/head.

Please test and report back.
Comment 2 Danny Kukawka 2008-08-11 09:25:03 UTC
Created attachment 18219 [details] [review]
new patch version
Comment 3 Danny Kukawka 2008-10-20 02:01:45 UTC
Fixed in git:

commit bdfc7b395872e0b9455752b48f88f6776f15ebb9
Author: Danny Kukawka <danny.kukawka@web.de>
Date:   Mon Aug 25 12:54:08 2008 +0200

    fixed Lock() handling

    Fixed Lock() handling.

    The current code store the lock information for a lock owner into a
    hash-table with these info: key=service_name of the lock owner and
    as value the device which was locked. Unfortunately this don't work
    if a service request more than one lock, because the old one get
    overwritten in the hash table. Use instead of the device a GSList
    with devices. This should solve

    If the lock owner dies, remove the locks of the old_service_name and
    not of the new_service_name (otherwise the locks get never released).


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.