[PATCH] clients: Free resources on exit in eventdemo

Pekka Paalanen ppaalanen at gmail.com
Sun Jul 8 23:44:46 PDT 2012


On Sun, 08 Jul 2012 15:59:44 +0200
Martin Olsson <martin at minimum.se> wrote:

> On 07/08/2012 03:09 PM, Pekka Paalanen wrote:
> > Looks good to me now, I assume you tested this program exits
> > properly. Btw. have you tried Valgrind on these?
> 
> Yes I tried it; FWIW with the new call to display_destroy the 
> eventdemo app now hits invalid read, invalid write and finally an 
> assert. However, other clients that do clean up after themselves (like 
> clients/resizor) already had this problem, so I believe that's a 
> separate bug. Leaks-wise valgrind spams mesa/driver leaks (4M valgrind 
> log) in both cases so the only "verification" I got was that the 
> static analyzer no longer finds the fixed leak.

Yeah, when Mesa is in the picture, you need lots of suppressions to
make the Valgrind output bearable. I did that in the past:
http://lists.freedesktop.org/archives/wayland-devel/2012-January/001767.html

It is likely, that the needed suppressions have changed, but that could
be a starting point. Or, you can disable Cairo-GL support, and have
software rendering toytoolkit clients, which should avoid Mesa.

> ==22498== Invalid read of size 4
> ==22498==    at 0x59361C1: xkb_state_unref (state.c:492)
> ==22498==    by 0x407F26: display_destroy (window.c:3297)
> ==22498==    by 0x4048D3: main (eventdemo.c:382)
> ==22498==  Address 0xa8efe34 is 36 bytes inside a block of size 72 free'd
> ==22498==    at 0x4C2A82E: free (in 
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==22498==    by 0x407EDB: display_destroy (window.c:3342)
> ==22498==    by 0x4048D3: main (eventdemo.c:382)
> ==22498==
> ==22498== Invalid write of size 4
> ==22498==    at 0x59361CD: xkb_state_unref (state.c:492)
> ==22498==    by 0x407F26: display_destroy (window.c:3297)
> ==22498==    by 0x4048D3: main (eventdemo.c:382)
> ==22498==  Address 0xa8efe34 is 36 bytes inside a block of size 72 free'd
> ==22498==    at 0x4C2A82E: free (in 
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==22498==    by 0x407EDB: display_destroy (window.c:3342)
> ==22498==    by 0x4048D3: main (eventdemo.c:382)

Aha, so either toytoolkit (window.c) is using libxkbcommon wrong, or
libxkbcommon has some problems itself. That would be nice to
investigate.


Thanks,
pq


More information about the wayland-devel mailing list