python-dmidecode possible memory leak
by MESNAGE Sylvain
Hello guys,
I finally found this mailing list that seems to be specifically dedicated to the python-dmidecode module, so after trying very hard to understand what happens I finally decided to submit you my issue in case someone can help.
I wrote a simple test program that repeatedly queries bios information from the python-dmidecode module (see attached file), it works perfectly whatever the API and options I use, it does exactly what it is intended to do!
The problem is: if I run this sample script under valgrind (valgrind -leak-chek=full python test_dmidecode.py) it seems that for each call made to any of the python-dmidecode query functions some memory is lost:
print dmidecode.QuerySection('bios') #1791 bytes lost per call
print dmidecode.bios() #1791 bytes lost per call
print dmidecode.dmidecodeXML().QuerySection('bios') #40 bytes lost per call
I'm working on a CentOS 6.4 x86_64 machine with (all stock versions of packages): python 2.6.6, libxml2 2.7.6, dmidecode 2.11 and python-dmidecode 3.10.13.
I also tried with the latest 3.12.2 version of python-dmidecode built from source, but the result is the same (it works, but according to valgrind the leak is even bigger) !
Since I'm not a Python expert I might be doing something wrong or misusing the python-dmidecode module, but if so, I could not find anywhere the information on how to properly "clean/free" the allocated data, neither in the documentation nor in the provided examples ...
If you have any information regarding this behavior (whether it is considered as normal or not), I would be pleased to read from you and make some more testing.
Thanks in advance for the time you'll spend on my request.
Best regards.
Sylvain Mesnage
[@@ OPEN @@]
8 years, 10 months