Bug 246255

Summary: memory leak in librpm
Product: [Fedora] Fedora Reporter: Andrew <bircoph>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-07-04 13:23:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew 2007-06-29 16:41:20 UTC
Description of problem:
Memory leak in librpm occurs after rpmReadConfigFiles(NULL, NULL) call.

Version-Release number of selected component (if applicable):
$ rpm -q rpm
rpm-4.4.2-39

How reproducible:
always

Steps to Reproduce:
1. just call rpmReadConfigFiles(NULL, NULL); in your program
2. compile it with debug info
3. run valgrind --leak-check=full ./your_program
  
Actual results:
==27880== 49 bytes in 2 blocks are definitely lost in loss record 9 of 34
==27880==    at 0x1B904812: malloc (vg_replace_malloc.c:149)
==27880==    by 0x1BB16656: rpmGlob (in /usr/lib/librpmio-4.4.so)
==27880==    by 0x1BB1A0E1: rpmInitMacros (in /usr/lib/librpmio-4.4.so)
==27880==    by 0x1B9867BC: rpmReadConfigFiles (in /usr/lib/librpm-4.4.so)
==27880==    by 0x804A81C: main (symbol_lookup.c:266)
==27880==
==27880==
==27880== 123 bytes in 5 blocks are definitely lost in loss record 12 of 34
==27880==    at 0x1B904812: malloc (vg_replace_malloc.c:149)
==27880==    by 0x1BB16879: rpmGlob (in /usr/lib/librpmio-4.4.so)
==27880==    by 0x1BB1A0E1: rpmInitMacros (in /usr/lib/librpmio-4.4.so)
==27880==    by 0x1B9867BC: rpmReadConfigFiles (in /usr/lib/librpm-4.4.so)
==27880==    by 0x804A81C: main (symbol_lookup.c:266)
==27880==
==27880==
==27880== 258 bytes in 2 blocks are definitely lost in loss record 13 of 34
==27880==    at 0x1B904812: malloc (vg_replace_malloc.c:149)
==27880==    by 0x1B984E82: (within /usr/lib/librpm-4.4.so)
==27880==    by 0x1B9858D4: (within /usr/lib/librpm-4.4.so)
==27880==    by 0x1B986750: rpmReadConfigFiles (in /usr/lib/librpm-4.4.so)
==27880==    by 0x804A81C: main (symbol_lookup.c:266)
==27880==
==27880== LEAK SUMMARY:
==27880==    definitely lost: 430 bytes in 9 blocks.
==27880==      possibly lost: 0 bytes in 0 blocks.
==27880==    still reachable: 70299 bytes in 2945 blocks.
==27880==         suppressed: 0 bytes in 0 blocks.

Expected results:
There should be no memory leak.

Comment 2 Panu Matilainen 2007-07-02 12:04:27 UTC
Yup, fixed in rpm.org tree (was already fixed in rpm5.org), will be in 4.4.2.1.

Comment 3 Panu Matilainen 2007-07-04 13:23:13 UTC
Will be fixed in next rawhide push.