Menu

#1325 OS_Base OperatingSystem Provider leaks some memory

Memory_Leak
open
Provider (226)
5
2013-02-08
2008-08-29
No

In OSBase_OperatingSystem.c, CIM_OS_DISTRO is calloc'd, but never free'd. get_operatingsystem_data is called (a alot, when indications are enabled) and CIM_OS_DISTRO gets calloc'd memory in get_os_distro(). There is a free() in _fini(), but _fini() is never called.

Discussion

  • Tyrel Datwyler

    Tyrel Datwyler - 2008-09-02

    Logged In: YES
    user_id=640104
    Originator: NO

    The _init() and _fini() functions are library constructors and destructors. The are called on library load and unload respectively. Adding an _OSBASE_TRACE call to both shows that they are called, and that CIM_OS_DISTRO is properly freed when the provider is unloaded. However, the use of these init/cleanup functions is frowned upon in favor of a newer means for exporting such function, and can be tracked here:

    http://sourceforge.net/tracker/index.php?func=detail&aid=2089383&group_id=128809&atid=712784

    Is there any valgrind data that may help point towards the actual culprit?

     
  • Tyrel Datwyler

    Tyrel Datwyler - 2008-09-23

    Chris, can you describe your approach to observing the suspected leak (ie. system load, scripts for recreation, etc).

     
  • Chris Buccella

    Chris Buccella - 2008-09-24

    I was testing indications using cmpi-base. I noticed that memory usage was increasing on each attempted indication delivery. get_os_distro() is called on each interval, so I simply saw sfcb memory usage creep up over time. This was found while trying to track down 1877578. I suppose ensuring it was the provider process that was growing in size would have been a good idea before pointing fingers (-:

     

Log in to post a comment.