[cmake-developers] memory leaks in cpack

Eric Noulard eric.noulard at gmail.com
Sat Mar 19 06:18:34 EDT 2011


2011/3/18 Eric Noulard <eric.noulard at gmail.com>:
> 2011/3/18 Eric Noulard <eric.noulard at gmail.com>:
>> 2011/3/18 Bill Hoffman <bill.hoffman at kitware.com>:
>>> On 3/18/2011 3:52 PM, Eric Noulard wrote:
>>>>
>>>> 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?
>>>>
>>>
>>> That said...
>>>
>>> The problem seems to be here:
>>>
>>>    dbfilename += this->GetOption("WDIR");
>>>
>>> My guess is WDIR is returning null from GetOption in this test which causes
>>> the crash.
>>
>> Yes you are right about the symptom.
>> The fact is we should never get to this point, because the reading of
>> CPackDeb.cmake have failed.
>>
>> -- stderr='CMake Error at
>> /home/eric/workspace/CMake-gitted/Modules/CPackDeb.cmake:274
>> (MESSAGE):
>>  CPackDeb: Debian package requires a maintainer for a package, set
>>  CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER
>
> Is it the expected behavior to have
> bool cmCPackGenerator::ReadListFile(const char* moduleName)
>
> return true when the processed list file exited because of a:
>
> MESSAGE(FATAL_ERROR "Whatever")
>
> how can I know whether if the processing of a list file encountered a
>
> message(ERROR
> message(FATAL_ERROR
> or
> return
>
> ?
>
> I can add some VAR "RUN_OK" to the concerned list file (CPackDeb.cmake)
> in order to know if it was processed "without error" but I find it awkward.

I did just pushed the fix to stage.
I did change the cmCPackGenerator::ReadListFile return status in order
to return "false" if the list file read ends-up with an ERROR or FATAL_ERROR.
I think this is more what you would expect from this method.
Currently it was used by CPack RPM, Deb and NSIS generators, RPM and Deb
did check the return value whereas NSIS just ignore it :-].
So the change should be safe.

Merge topic 'CPackDeb-fixTestCrash' into next

21007f8 CPack fix CPackDeb crash when CPackDeb.cmake ends with a FATAL_ERROR

Pushing upstream next
To git at cmake.org:cmake.git


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



More information about the cmake-developers mailing list