[cmake-developers] memory leaks in cpack

Eric Noulard eric.noulard at gmail.com
Fri Mar 18 15:52:57 EDT 2011


2011/3/18 Bill Hoffman <bill.hoffman at kitware.com>:
> 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:

Yes but this could be a real symptom a memory corruption.
What is the simplest way for me to run the same valgrind test locally?

Which ctest one line command, may use for that?


> ==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
>



-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org



More information about the cmake-developers mailing list