This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libobjc/54432] New: Memory leak when linking libobjc with gcc
- From: "karlkrch at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 31 Aug 2012 01:48:39 +0000
- Subject: [Bug libobjc/54432] New: Memory leak when linking libobjc with gcc
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54432
Bug #: 54432
Summary: Memory leak when linking libobjc with gcc
Classification: Unclassified
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: libobjc
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: karlkrch@gmail.com
Very simple test case.
Created a main.m file with contents:
`int main(){ return 1; }`
Compile with gcc:
`gcc main.m -o main -lobjc`
Run valgrind:
`valgrind main`
Get memory leak:
==27005== HEAP SUMMARY:
==27005== in use at exit: 8,485 bytes in 133 blocks
==27005== total heap usage: 145 allocs, 12 frees, 11,053 bytes allocated
==27005==
==27005== LEAK SUMMARY:
==27005== definitely lost: 16 bytes in 1 blocks
==27005== indirectly lost: 16 bytes in 1 blocks
==27005== possibly lost: 0 bytes in 0 blocks
==27005== still reachable: 8,453 bytes in 131 blocks
==27005== suppressed: 0 bytes in 0 blocks
If I don't link libobjc then I get no memory leaks. Not sure if this is a gcc
or valgrind bug.