Valgrind "definitely lost" backtrace

Richard Kimberly Heck rikiheck at lyx.org
Mon Feb 17 17:35:19 UTC 2020


On 2/17/20 8:17 AM, Pavel Sanda wrote:
> On Sun, Feb 16, 2020 at 07:21:17PM -0500, Scott Kostyshak wrote:
>> On Sat, Feb 15, 2020 at 09:42:52PM +0100, Pavel Sanda wrote:
>>> On Fri, Feb 14, 2020 at 08:09:09PM -0500, Scott Kostyshak wrote:
>>>> Thanks to both of you for taking a look. I was hoping to investigate
>>>> this memory leak but it seems to be beyond my knowledge.
>>> Do you have recipy to reproduce valgrind's warning?
>> 1. I run the following command (you will need to adapt it):
>>
>>   valgrind --leak-check=full --track-origins=yes --log-file=valgrind.log ~/lyxbuilds/master/CMakeBuild/bin/lyx -userdir ~/lyxbuilds/master/user-dir
>>
>> 2. Do "ctrl + n" to start a new document.
>>
>> 3. Type "abc".
>>
>> 4. Quit LyX and respond "no" when prompted whether to save the document.
>>
>> I attach the full log in case it is useful. The other warnings involve
>> external libraries.
>>
>> Can anyone else reproduce?
> I can reproduce. I looked now more carefully in the code, but couldn't
> find where in the code are delete operators corresponding to the new operator
> at TocModel.cpp:362.
>
> So this looks like we just forget to free memory at the end of TocModels
> life. As I know little about ToCXXX routines I would appreciate someone (Riki?)
> knowing the context ack my change before comitting.

I don't see how that could hurt. And it looks to me like the TocModels
objects are per-buffer. If so, then closing a file would leak, and I
think the patch would prevent that leak. I take it that it does silence
the warning?

Riki




More information about the lyx-devel mailing list