Bug 8517

Summary: memory leakage while installing or upgrading a package
Product: [Yocto Project Subprojects] opkg Reporter: jatin jain <jatinvatsalya>
Component: opkgAssignee: Alejandro del Castillo <alejandro.delcastillo>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Undecided    
Version: 0.3.0   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description jatin jain 2015-10-15 05:53:02 UTC
When ever we install any package that package is first downloaded into cache then it is installed. When the package is downloaded there is a leakage of number of bytes equal to size of file path.

If the package is already in cache then there is no leakage.

I checked the leakage using valgrind.
Comment 1 Alejandro del Castillo 2015-10-20 16:42:57 UTC
*** Bug 8518 has been marked as a duplicate of this bug. ***
Comment 2 Alejandro del Castillo 2015-10-20 16:43:16 UTC
*** Bug 8519 has been marked as a duplicate of this bug. ***
Comment 3 Alejandro del Castillo 2015-10-26 23:01:37 UTC
Indeed, opkg_download_pkg is leaking if a package is not on the cache:

==2528== 123 bytes in 1 blocks are definitely lost in loss record 3 of 6
==2528==    at 0x4C28F30: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2528==    by 0x4C2B2DF: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2528==    by 0x4E51248: xrealloc (xfuncs.c:45)
==2528==    by 0x4E50FB6: sprintf_alloc (sprintf_alloc.c:51)
==2528==    by 0x4E403E7: get_cache_location (opkg_download.c:145)
==2528==    by 0x4E4058B: opkg_download_pkg (opkg_download.c:264)
==2528==    by 0x4E41C57: opkg_install_pkg (opkg_install.c:1419)
==2528==    by 0x4E427E3: opkg_install_by_name (opkg_install.c:1299)
==2528==    by 0x4E3FD3F: opkg_install_cmd (opkg_cmd.c:423)
==2528==    by 0x401583: main (opkg.c:406)
Comment 4 Alejandro del Castillo 2015-11-04 17:53:35 UTC
Fixed on 7c3fc63f2393aa8960b60be87fbd6f5e799693e4