[cmake-developers] memory leaks in cpack

Bill Hoffman bill.hoffman at kitware.com
Fri Mar 18 14:54:55 EDT 2011


On 3/18/2011 11:00 AM, Eric Noulard wrote:
> 2011/3/18 Bill Hoffman<bill.hoffman at kitware.com>:
>>
>> The commits that went in this day:
>>
>> http://www.cdash.org/CDash/viewChanges.php?project=CMake&date=2011-03-12
>>
>> Caused memory leaks to show up here:
>>
>> http://www.cdash.org/CDash/viewDynamicAnalysisFile.php?id=1142597
>
> May be for me.
> I'll have a look tonight.

With a closer look, it seems that it is actually crashing under valgrind:


>
==21354==
  ==21354== Invalid read of size 1
==21354==    at 0x4C270C2: strlen (mc_replace_strmem.c:242)
==21354==    by 0x530886B: std::string::operator+=(char const*) (in 
/usr/lib/libstdc++.so.6.0.10)
==21354==    by 0x613511: cmCPackDebGenerator::createDeb() 
(cmCPackDebGenerator.cxx:303)
==21354==    by 0x617227: cmCPackDebGenerator::PackageFiles() 
(cmCPackDebGenerator.cxx:292)
==21354==    by 0x5FC1EC: cmCPackGenerator::DoPackage() 
(cmCPackGenerator.cxx:1012)
==21354==    by 0x5EA0CE: main (cpack.cxx:430)
==21354==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==21354==
==21354== Process terminating with default action of signal 11 (SIGSEGV)
==21354==  Access not within mapped region at address 0x0
==21354==    at 0x4C270C2: strlen (mc_replace_strmem.c:242)
==21354==    by 0x530886B: std::string::operator+=(char const*) (in 
/usr/lib/libstdc++.so.6.0.10)
==21354==    by 0x613511: cmCPackDebGenerator::createDeb() 
(cmCPackDebGenerator.cxx:303)
==21354==    by 0x617227: cmCPackDebGenerator::PackageFiles() 
(cmCPackDebGenerator.cxx:292)
==21354==    by 0x5FC1EC: cmCPackGenerator::DoPackage() 
(cmCPackGenerator.cxx:1012)
==21354==    by 0x5EA0CE: main (cpack.cxx:430)
==21354==  If you believe this happened as a result of a stack overflow 
in your
==21354==  program's main thread (unlikely but possible), you can try to 
increase
==21354==  the size of the main thread stack using the --main-stacksize= 
flag.
==21354==  The main thread stack size used in this run was 8388608.
==21354==


-- 
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoffman at kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573



More information about the cmake-developers mailing list