Anyone tried using Valgrind to find memory leaks in Evolution?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Anyone tried using Valgrind to find memory leaks in Evolution?

Jeff-208
Hi there,
Since I often find Evolution (3.38.x) consuming over a gigabyte of RAM,
I was a bit curious to see if I could somehow run it under Valgrind and
see if it reports a memory leak of some kind.

On Fedora 33 (with SELinux disabled), this is what I ran:


dnf debuginfo-install -y evolution evolution-data-server

G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind \
--suppressions=/usr/share/glib-2.0/valgrind/glib.supp \
--num-callers=50 --tool=memcheck --leak-check=full \
--show-leak-kinds=definite --track-origins=yes \
--log-file=evolution.valgrind evolution


I waited a pretty long time for it to start under those conditions, but
after many minutes of waiting, it crashed before being able to start;
all I got were these errors:

** WARNING **: Failed to seal memfd: Invalid argument
** WARNING **: Failed to seal memfd: Invalid argument
** ERROR **: Failed to write memfd
Trace/breakpoint trap (core dumped)

I don't know what to do next; that same command worked for Nautilus.
Has anyone attempted this? Is there a better way?

_______________________________________________
evolution-list mailing list
[hidden email]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list
Reply | Threaded
Open this post in threaded view
|

Re: Anyone tried using Valgrind to find memory leaks in Evolution?

Gnome Evolution - General mailing list
On Mon, 2021-01-04 at 21:55 -0500, Jeff wrote:
> I don't know what to do next; that same command worked for Nautilus.
> Has anyone attempted this? Is there a better way?

        Hi,
one part of the preallocated memory can be a gigacage used by
WebKitGTK. It's better to disable it when running under valgrind. My
commands look like this:

   $ export GIGACAGE_ENABLED=0
   $ G_SLICE=always-malloc valgrind --show-leak-kinds=definite \
       --num-callers=30 --leak-check=full \
       --aspace-minaddr=0x100000000 evolution &>log.txt

Make sure you've installed debuginfo packages for glib2, gtk3,
evolution-data-server and evolution at least, to get usable backtraces.
        Bye,
        Milan

_______________________________________________
evolution-list mailing list
[hidden email]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list
Reply | Threaded
Open this post in threaded view
|

Re: Anyone tried using Valgrind to find memory leaks in Evolution?

Jeff-208
On Tue, 2021-01-05 at 09:49 +0100, Milan Crha via evolution-list wrote:
[...]
> one part of the preallocated memory can be a gigacage used by
> WebKitGTK. It's better to disable it when running under valgrind.
> My commands look like this:
>
>    $ export GIGACAGE_ENABLED=0
>    $ G_SLICE=always-malloc valgrind --show-leak-kinds=definite \
>        --num-callers=30 --leak-check=full \
>        --aspace-minaddr=0x100000000 evolution &>log.txt

Thanks for the tip. I tried that command (as well as my previous
command but with the GIGACAGE_ENABLED=0 variable), and unfortunately
I still get the same thing as before:

** WARNING **: Failed to seal memfd: Invalid argument
** WARNING **: Failed to seal memfd: Invalid argument
** ERROR **: Failed to write memfd
Trace/breakpoint trap (core dumped)


Any ideas what to do with that?


> Make sure you've installed debuginfo packages for glib2, gtk3,
> evolution-data-server and evolution at least, to get usable
> backtraces.

Yup, I did!

_______________________________________________
evolution-list mailing list
[hidden email]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list
Reply | Threaded
Open this post in threaded view
|

Re: Anyone tried using Valgrind to find memory leaks in Evolution?

Gnome Evolution - General mailing list
On Tue, 2021-01-05 at 09:26 -0500, Jeff wrote:
> Any ideas what to do with that?

        Hi,
not much idea, without knowing where it happened. Being it still in
WebKitGTK code, like in bmalloc, then compiling it with
-DUSE_SYSTEM_MALLOC=ON may eventually help, but it's only a wild guess,
possibly out of any usable thing. I think I saw this memfd thing
somewhere, but I'm not sure, neither I've any hint on it.
        Bye,
        Milan

_______________________________________________
evolution-list mailing list
[hidden email]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list
Reply | Threaded
Open this post in threaded view
|

Re: Anyone tried using Valgrind to find memory leaks in Evolution?

Gnome Evolution - General mailing list
In reply to this post by Jeff-208
On Tue, 2021-01-05 at 09:26 -0500, Jeff wrote:
> ** WARNING **: Failed to seal memfd: Invalid argument
> ** WARNING **: Failed to seal memfd: Invalid argument
> ** ERROR **: Failed to write memfd

        Hi,
I've been just told how to run things which use WebKitGTK under
valgrind here:
https://bugzilla.redhat.com/show_bug.cgi?id=1914917#c23

Long story short:

$ WEBKIT_FORCE_SANDBOX=0 GIGACAGE_ENABLED=0 G_SLICE=always-malloc \
    Malloc=1 valgrind --show-leak-kinds=definite \
    --num-callers=30 --leak-check=full \
    --aspace-minaddr=0x100000000 evolution &>log.txt

        Bye,
        Milan

_______________________________________________
evolution-list mailing list
[hidden email]
To change your list options or unsubscribe, visit ...
https://mail.gnome.org/mailman/listinfo/evolution-list