Project

General

Profile

Bug #11796

libpcidb leaks file descriptors

Added by Robert Mustacchi over 1 year ago. Updated over 1 year 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
#1

Updated by Electric Monk over 1 year 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>

Also available in: Atom PDF