[vlc-devel] Re : commit: Qt: delete unneeded MenuItemData (Jakob Leben )

brezhoneg1 brezhoneg1 at yahoo.fr
Tue Apr 6 14:24:12 CEST 2010


   More info :

   - I do use QT4.4.3 on Debian5.0 and also QT4.4.3 for Win32 cross-compilation
   - The crash occurs for both plateforms 
   - The additional patch you attached to the previous email did not solve the problem
   - gdb trace (not of much help)

        [Switching to Thread 0xb7b846b0 (LWP 8160)]
0xb7bb42c1 in getenv () from /lib/i686/cmov/libc.so.6
(gdb) bt
#0  0xb7bb42c1 in getenv () from /lib/i686/cmov/libc.so.6
#1  0xb7bac5de in ?? () from /lib/i686/cmov/libc.so.6
#2  0xb7cc0581 in ?? () from /lib/i686/cmov/libc.so.6
#3  0x080f8014 in ?? ()
#4  0xb7bab6f0 in ?? () from /lib/i686/cmov/libc.so.6
#5  0xbfdf4f34 in ?? ()
#6  0xb7ff57c4 in ?? ()
#7  0xbfdf4f40 in ?? ()
#8  0x465f7266 in ?? ()
#9  0x54552e52 in ?? ()
#10 0x00382d46 in ?? ()
#11 0x00000027 in ?? ()
#12 0xb7cc053c in ?? () from /lib/i686/cmov/libc.so.6
#13 0x00000005 in ?? ()
#14 0xbfdf4e80 in ?? ()
#15 0x00000001 in ?? ()
#16 0x00000000 in ?? ()

   valgrind trace (a bit more helpful)
   valgrind clearly states there is a problem when releasing vlc objects

==8151==  Address 0x4a8a0b0 is 40 bytes inside a block of size 43 alloc'd
==8151==    at 0x4022D6E: malloc (vg_replace_malloc.c:207)
==8151==    by 0x400DB23: (within /lib/ld-2.7.so)
==8151==    by 0x4008555: (within /lib/ld-2.7.so)
==8151==    by 0x4011B46: (within /lib/ld-2.7.so)
==8151==    by 0x400DA15: (within /lib/ld-2.7.so)
==8151==    by 0x401154D: (within /lib/ld-2.7.so)
==8151==    by 0x4319C2B: (within /lib/i686/cmov/libdl-2.7.so)
==8151==    by 0x400DA15: (within /lib/ld-2.7.so)
==8151==    by 0x431A05B: (within /lib/i686/cmov/libdl-2.7.so)
==8151==    by 0x4319B60: dlopen (in /lib/i686/cmov/libdl-2.7.so)
==8151==    by 0x66D8A06: QLibraryPrivate::load_sys() (qlibrary_unix.cpp:204)
==8151==    by 0x66D302B: QLibraryPrivate::load() (qlibrary.cpp:458)
vlc: misc/objects.c:596: vlc_object_release:  assertion « internals->first == ((void *)0) failed

   - I traced all MenuItemData creations and destructions. The problem is that not all MenuItemData are destroyed, leading to vlc probably crashing in debug mode because some objects are still refcounted.
     The difference between __before__ and __after__ the first patch is that the QObject used as parent for MenuItemData has changed. I guess that the new parents (actions) are not properly destroyed (memory leak) and therefore MenuItemData (as a child) are not destroyed either. Since they still hold a reference on a vlc object, it is bound to crash in debug mode

    If my guess were to come true, then you should also experience the same problems. It should not be dependent on the version of QT, unless QT has got some sort of garbage collector for action/menus in a more recent version. ....... More investigation needed !



More information about the vlc-devel mailing list