Project

General

Profile

Actions

Bug #11796

closed

libpcidb leaks file descriptors

Added by Robert Mustacchi almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

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
Actions

Also available in: Atom PDF