Bug #11796
closedlibpcidb leaks file descriptors
100%
Description
Alex Wilson found an fmd core at UQ that had run out of file descriptors. Using pfiles on the core, we discovered that the most common file was /usr/share/hwdata/pci.ids. The way that libpcidb is designed, it opens up the pci.ids file and parses it once as the handle is opened. At that point, it no longer needs the file at all. Unfortunately, we end up leaking the file handle. Most software that has used libpcidb to date has been user land commands that are short lived, so this was missed. However, with the introduction of '9113 Expose vendor-name/device-name/subsystem-name as props on pcifn/pciexfn topo nodes' this caused fmd to start using libpcidb where this was noticeable.
To test this I did the following with an updated libpcidb library present:
- Made sure that prtconf -dD correclty showed device names
- Used pfiles to verify that there were no more leaked pci.ids flies in fmd
- Verified that the fmd properties for PCI devices that used the database still worked
Updated by Electric Monk about 4 years ago
- Status changed from New to Closed
git commit 1b5fde4ead97be960bc3ea43dd9491cef5604668
commit 1b5fde4ead97be960bc3ea43dd9491cef5604668 Author: Robert Mustacchi <rm@fingolfin.org> Date: 2019-10-15T19:09:59.000Z 11796 libpcidb leaks file descriptors Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Garrett D'Amore <gdamore@damore.org> Approved by: Dan McDonald <danmcd@joyent.com>