[Bug binutils/868] bfd leaks memory in several places

2008-04-10 Thread andrejoh at gmail dot com

--- Additional Comments From andrejoh at gmail dot com  2008-04-10 09:08 
---
Nick, I'm not sure reverting the cleanup is correct.  At least in binutils 
2.18, the function concat_filename uses bfd_malloc, which again uses malloc.  
As far as I can see, it does the same in current CVS.


I get leak reports like this when running under Valgrind:

==28969== 120,701 bytes in 1,422 blocks are definitely lost in loss record 2 
of 2
==28969==at 0x4904A06: malloc (vg_replace_malloc.c:149)
==28969==by 0x407305: bfd_malloc (libbfd.c:173)
==28969==by 0x46BC09: concat_filename (dwarf2.c:1064)
==28969==by 0x46CBFC: scan_unit_for_symbols (dwarf2.c:1936)
==28969==by 0x46CFFE: comp_unit_find_nearest_line (dwarf2.c:2262)
==28969==by 0x46DD9D: find_line (dwarf2.c:3093)
==28969==by 0x46E4A6: _bfd_dwarf2_find_nearest_line (dwarf2.c:3127)
==28969==by 0x41F3DA: _bfd_elf_find_nearest_line (elf.c:6889)


Running with a change similar to the one in comment #14 plus freeing 
caller_file removes the leaks I see when doing call-stack mapping.
(CentOS 4.5/x86_64. using GCC 4 gcc4-4.1.1-53.EL4 and BFD from binutils 2.18.)


-- 
   What|Removed |Added

 CC||andrejoh at gmail dot com
 Status|RESOLVED|REOPENED
 Resolution|FIXED   |


http://sourceware.org/bugzilla/show_bug.cgi?id=868

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/868] bfd leaks memory in several places

2008-04-10 Thread andrejoh at gmail dot com

--- Additional Comments From andrejoh at gmail dot com  2008-04-10 10:15 
---
That should of course be comment #4.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=868

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/868] bfd leaks memory in several places

2008-04-15 Thread andrejoh at gmail dot com

--- Additional Comments From andrejoh at gmail dot com  2008-04-15 20:12 
---
Created an attachment (id=2697)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=2697&action=view)
Leak fixing for bfd_find_nearest_line in DWARF2


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=868

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils