[mythtv] possible filter manager leak

Erik Hovland erik at hovland.org
Sat Mar 15 01:07:20 UTC 2008


On Fri, Mar 14, 2008 at 11:45:07AM -0400, Daniel Kristjansson wrote:
> On Fri, 2008-03-14 at 08:31 -0700, Erik Hovland wrote:
> > On Sat, Mar 15, 2008 at 01:30:25AM +1100, Mark Spieth wrote:
> > > Im not sure what the intention is with filter management, but in 
> > > filtermanager
> > > the libs opened with LoadFilterLib's dlopen are not dlclosed at any time. 
> > > This happens via the constructor of the filter manager. This also dlopens 
> > > all filters every time. I found this because I was chasing a deadlock inside 
> > > dlopen on play start which ended up being mythphone's fault (no mythphone, 
> > > no deadlock :-).
> > > 
> > > when a filter is used, it is dlopened again, and when done dlclosed but only 
> > > those that are used. so this part is good.
> > > 
> > > I may be wrong, but I suspect this is a handle leak.
> > 
> > According to coverity prevent, you are correct. This is reported as a
> > file resource leak.
> > 
> > If I read the man page for dlcose correctly, the dl file handle is ref
> > counted. So it "should" be safe to call dlclose on the handle after a
> > symbol has been loaded.
> 
> I think that would work, we do something similar for xshm where we close
> it as soon as we have a reference, and it gets collected by the OS when
> we are finished with the reference. Please add a comment for this in the
> patch so that this doesn't get "fixed" later by someone else as it is a
> bit unusual.

patch (with comment) and ticket created:
http://svn.mythtv.org/trac/ticket/4957

E

-- 
Erik Hovland
mail: erik at hovland.org
web: http://hovland.org/
PGP/GPG public key available on request



More information about the mythtv-dev mailing list