Memory leak from list<CloneList *>
Scott Kostyshak
skostysh at lyx.org
Wed Feb 19 15:13:55 UTC 2020
On Wed, Feb 19, 2020 at 08:52:18AM +0000, Neven Sajko wrote:
> > Well, actually the hardest part is waiting because LyX is very slow when run under valgrind.
>
> Try sanitizers instead. They are instrumentation that GCC or Clang can
> include in executables. They do basically the same thing as Valgrind,
> but should be much faster and since you are already compiling your own
> Lyx and Qt, the sanitizers should be a more appropriate tool. There
I do not always compile Qt. On my last attempt to compile Qt I came
across an error and just used the pre-built libraries (and I think the
corresponding -dbg packages). I did not initially realize that compiling
Qt with the address sanitizers would make a big difference, but now I
think I see the intuition: LyX might be responsible for a sanitizer
error at the Qt level, and we would only catch that if we compile Qt
with the address sanitizers.
> are four sanitizers that you may want to compile with: asan, tsan,
> msan, ubsan; each for a different class of bugs.
>
> Instructions: include -fsanitize=asan (replace asan with wanted
> sanitizer if you want another one) to both compilation and linking
> commands (GCC or Clang) of all libraries and code. It is also a good
> idea to disable some compiler optimizations, in particular one should
> use -fno-omit-frame-pointer. See
> https://github.com/google/sanitizers/wiki for more information.
>
> By default the error reports will be output to stderr, but it is
> possible to output them to a file by setting an environment variable
> (search for log_path in
> https://github.com/google/sanitizers/wiki/AddressSanitizerFlags if in
> need of that option).
>
> I hope that was helpful.
Thanks, Neven! This is helpful. I've been meaning to look into tools
like this for a while, and this might be just the push I needed.
Eventually I would like to add these options to the building and testing
scripts at https://github.com/scottkosty/lyx-tester. It would be
interesting to build with a sanitizer and then run our big suite of
automated tests. I made an issue to remind me to look into this,
although I probably won't look into it soon (just because of time
reasons and other pending tasks):
https://github.com/scottkosty/lyx-tester/issues/1
Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200219/f0b5bce2/attachment.asc>
More information about the lyx-devel
mailing list