Red Hat Bugzilla – Bug 244995
hald is leaking memory with apm
Last modified: 2013-03-05 22:51:08 EST
Description of problem:
When hald is running on a system with apm, it leaks memory. I noticed this on a
system where hald was using 85 % of the memory (compared to 0.8 % when freshly
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Start hald
2. Wait several hours
3. Initially, the memory usage doesn't grow, but after a while it starts growing
A memory leak
No memory leak
In hald/linux/apm.c in the function apm_poll,
hal_device_store_match_multiple_key_value_string is called. It returns a pointer
to a GSList, which is generated with calls to g_slist_prepend in that function.
This singly-linked list should be freed once it has been used in apm_poll, but
this is not the case.
I propose to add a call to g_slist_free at the end of apm_poll to fix this leak.
This is quite a big leak, because apm_poll is called every 2 seconds. It brings
my system to its knees in a few days. However, I suspect it is not the only one.
handle_match in device_info.c looks suspicious, where it deals with siblings.
Created attachment 157464 [details]
patch adding a call to g_slist_free
Looks like an easy fix, that is still missing in upstream git. David ?
I can confirm that this patch fixes this bug on my computer. After applying it
hald memory usage does not grow anymore and it was growing over 200MB/month before.
A more comprehensive leak fix was recently posted on the hal list:
Is a fix for this leak included in hal-0.5.10-1.fc8?
Because that's the version I'm using and I have a similar (the same?) problem.
I just checked the source code of hal-0.5.10-1.fc8, and the fix is not included.
However, the fix mentioned in comment #4 was added to the upstream repository at
Could someone build and release an update with at least this fix included?
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.
Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.
Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:
The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Thomas is this still an issue with F9? If so, please email the HAL mailing list
with your patch and I'll make sure itgets reviewed. Thanks.
(In reply to comment #9)
> Thomas is this still an issue with F9? If so, please email the HAL mailing
> with your patch and I'll make sure itgets reviewed. Thanks.
The computer I had which needed apm, which caused me to spot this bug has
died, so I can't test anything, but looking at the source code from:
it would seem that the missing g_slist_free which my patch added has been
integrated into that release. So I expect that the problem is fixed once and
for all and there's certainly no need to review my one-line patch as it seems
to have already been included in the mainstream hal distribution.
Maybe Thomas can confirm if this works for him too.
But Fedora 8 is affected badly. Could you, please, reopen this bug for Fedora 8.
And release an errata package?
I'll try to build an F8 package now.
hal-0.5.10-3.fc8 has been submitted as an update for Fedora 8
hal-0.5.10-3.fc8 has been pushed to the Fedora 8 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
su -c 'yum --enablerepo=updates-testing update hal'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-5380
Fedora 7 changed to end-of-life (EOL) status on June 13, 2008.
Fedora 7 is no longer maintained, which means that it will not
receive any further security or bug fix updates. As a result we
are closing this bug.
If you can reproduce this bug against a currently maintained version
of Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.
Re-opening and switching component to F-8, as this bug still exists in F-8 and
should be closed by bodhi as CURRENTRELEASE, not CANTFIX.
Also there appears to have been some maintainer miscommunication as Richard
Hughes obsoleted the existing updates-testing update (originally pushed by dcbw):
by pushing a new update for hal:
but crucially, he didn't also append the hal-info-20080607-1.fc8 from dcbw's
previous update to the new update, effectively obsoleting the hal-info update at
the same time which is necessary to fix a bug in pilot link (bug #280251 comment
Can I just bump and rebuild hal-info and push to stable?
(In reply to comment #18)
> Can I just bump and rebuild hal-info
Yes, presuming you mean pull from current freedesktop git. We need the hal-info
you (accidentally?) obsoleted back. More recent is fine.
>We need the hal-info you (accidentally?) obsoleted
Sure, I didn't know a hal-info was staged -- apologies. I'll rebuild hal-info as
soon as I'm back from the summit.
hal-info-20080607-2.fc8 has been submitted as an update for Fedora 8
hal-info-20080607-2.fc8 has been pushed to the Fedora 8 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
su -c 'yum --enablerepo=updates-testing update hal-info'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-5475
The hal/hal-info combination in updates-testing seems to have triggered another
bug for some users - bug #452701 - which could do with some attention.
Will the bad karma in bodhi block this update because of it?
I've found a debian patch that looks like the appropriate fix and referenced it
in bug #452701.
(Bug #280251 has been blocked on a hal update - or even just packager
communication! - for nigh on 5 months now, sadly)
hal-info-20080607-2.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.
hal-0.5.10-3.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.