First Last Prev Next    No search results available
Details
: [vmcore] OpaqueType objects memory leak
Bug#: 196
: libraries
: Core LLVM classes
Status: RESOLVED
Resolution: FIXED
: All
: All
: 1.0
: P2
: normal
: 1.2

:
: quality-of-implementation
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Chris Lattner <sabre@nondot.org>
Assigned To: Chris Lattner <sabre@nondot.org>

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2003-12-23 17:46
Valgrind reports that many OpaqueType objects are routinely leaked by LLVM,
routinely adding up to 1.5MB or so.

-Chris
------- Comment #1 From Chris Lattner 2003-12-23 17:49:04 -------
The main patch is here:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20031222/010442.html

The problem was that the PATypeHolder object was addref'ing types when it was
created, but not dropRef'ing the type when it was destroyed.  Whoops.

Fixing this exposed the following latent bugs in the asmparser:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20031222/010439.html
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20031222/010440.html

-Chris
------- Comment #2 From Chris Lattner 2003-12-23 17:59:01 -------
Oh in case anyone cares, here's the typical valgrind output that this fixes:

64 bytes in 1 blocks are definitely lost in loss record 2 of 4
  at 0x40028B85: __builtin_new (vg_replace_malloc.c:172)
  by 0x40028BF0: operator new(unsigned) (vg_replace_malloc.c:185)
  by 0x8242F83: llvm::OpaqueType::get() (DerivedTypes.h:430)
  by 0x8231BB5: llvm::getTypeVal(llvm::ValID const&, bool) (llvmAsmParser.y:274)
  by 0x8234CE4: llvmAsmparse() (llvmAsmParser.y:913)
  by 0x82337F6: llvm::RunVMAsmParser(std::string const&, _IO_FILE*)
(llvmAsmParser.y:643)
  by 0x8231213: llvm::ParseAssemblyFile(std::string const&) (Parser.cpp:35)
  by 0x822D71C: main (gccas.cpp:105)

Though anything that creates Opaque or otherwise abstract types can be found to
be the leak, including the bytecode reader.

-Chris

First Last Prev Next    No search results available