[vlc-devel] commit: Hack to get the leaked object tree back ( Rémi Denis-Courmont )

xxcv xxcv07 at gmail.com
Fri Mar 6 14:21:59 CET 2009


Hello,

git version control wrote:
> vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Mar  5 22:27:30 2009 +0200| [bde4f0ba22eb98928ed68b236d5cd80efbe0651d] | committer: Rémi Denis-Courmont 
>
> Hack to get the leaked object tree back
>
>   
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bde4f0ba22eb98928ed68b236d5cd80efbe0651d
>>     
> ---
>
>  src/libvlc.c       |    6 ++++++
>  src/misc/objects.c |    5 +++--
>  2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/src/libvlc.c b/src/libvlc.c
> index e949996..f90994d 100644
> --- a/src/libvlc.c
> +++ b/src/libvlc.c
> @@ -1134,6 +1134,12 @@ void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
>      vlc_mutex_destroy( &priv->config_lock );
>      vlc_mutex_destroy( &priv->timer_lock );
>  
> +#ifndef NDEBUG /* Hack to dump leaked objects tree */
> +    if( vlc_internals( p_libvlc )->i_refcount > 1 )
> +        while( vlc_internals( p_libvlc )->i_refcount > 0 )
> +            vlc_object_release( p_libvlc );
> +#endif
> +
>      assert( vlc_internals( p_libvlc )->i_refcount == 1 );
>      vlc_object_release( p_libvlc );
>  }
> diff --git a/src/misc/objects.c b/src/misc/objects.c
> index 3f55190..13f1a84 100644
> --- a/src/misc/objects.c
> +++ b/src/misc/objects.c
> @@ -572,8 +572,6 @@ void __vlc_object_release( vlc_object_t *p_this )
>  
>      if( b_should_destroy )
>      {
> -        /* We have no children */
> -        assert (internals->i_children == 0);
>          parent = p_this->p_parent;
>  
>  #ifndef NDEBUG
> @@ -607,6 +605,9 @@ void __vlc_object_release( vlc_object_t *p_this )
>          if (parent)
>              /* Detach from parent to protect against FIND_CHILDREN */
>              vlc_object_detach_unlocked (p_this);
> +
> +        /* We have no children */
> +        assert (internals->i_children == 0);
>   

vlc.exe have already quit is there a point of assert here ?!
This assert fails at the last seconds before vlc.exe is shutdown completely.

Deint / Blend + quit assert fail misc/objects.c line 610.

------------------------------------------------------------------------

[0x642f54] main libvlc debug: removing playlist
[0x4e018c] main playlist debug: Destroyed
[0x642f54] main libvlc debug: removing interaction
[0x642f54] main libvlc debug: TIMER ML Load : Total 227.000 ms / 1 
intvls (Avg 227.000 ms)
[0x642f54] main libvlc debug: TIMER Items array build : Total 0.000 ms / 
2 intvls (Avg 0.000 ms)
[0x642f54] main libvlc debug: TIMER ML Dump : Total 4.000 ms / 1 intvls 
(Avg 4.000 ms)
[0x642f54] main libvlc debug: removing stats
[0x642f54] main libvlc debug: removing module "memcpymmxext"
[0x642f54] main libvlc debug: opening config file 
(C:\Users\vista\AppData\Roaming\vlc\vlcrc)
[0x642f54] main libvlc debug: opening config file 
(C:\Users\vista\AppData\Roaming\vlc\vlcrc)
[0x642f54] main libvlc debug: writing plugins cache 
C:\Users\vista\AppData\Roaming\vlc\plugins-zxzx04.dat
ERROR: leaking object (0x10892f2c, type:generic, name:fontlist builder)
[New thread 21136.0x49cc]
[New thread 21136.0x46d4]

Program received signal SIGTRAP, Trace/breakpoint trap.
0x77554aaf in msvcrt!_assert () from C:\Windows\syswow64\msvcrt.dll
(gdb) Error: dll starting at 0x77b60000 not found.
Error: dll starting at 0x76290000 not found.
Error: dll starting at 0x77b60000 not found.
Error: dll starting at 0x77a90000 not found.
bt
#0  0x77554aaf in msvcrt!_assert () from C:\Windows\syswow64\msvcrt.dll
#1  0x6a5926a3 in __vlc_object_release (p_this=0x642f54) at 
misc/objects.c:276
#2  0x6a541616 in libvlc_InternalDestroy (p_libvlc=0x642f54) at 
libvlc.c:1140
#3  0x6a301488 in libvlc_release (p_instance=0x643730) at control/core.c:175
#4  0x004013f6 in WinMain (hInstance=0x400000, hPrevInstance=0x0,
    lpCmdLine=0x943e26 "", nCmdShow=10) at winvlc.c:153
#5  0x004015aa in main ()
------------------------------------------------------------------------

vlc.exe caused a Breakpoint at location 77554aae in module msvcrt.dll.

Call stack:
77554AAE  msvcrt.dll:77554AAE  _assert
6A5926A3  libvlccore.dll:6A5926A3  __vlc_object_release  objects.c:282
void __vlc_object_release(
    vlc_object_t * p_this = &(indirect)
)
6A541616  libvlccore.dll:6A541616  libvlc_InternalDestroy  libvlc.c:1140
void libvlc_InternalDestroy(
    libvlc_int_t * p_libvlc = &(indirect)
)
6A301488  libvlc.dll:6A301488  libvlc_release  core.c:176
void libvlc_release(
    libvlc_instance_t * p_instance = &(indirect)
)
004013F6  vlc.exe:004013F6  WinMain  winvlc.c:153
int WinMain(
    HINSTANCE hInstance = &{
        int i = 9460301
    },
    HINSTANCE hPrevInstance = &{
        int i =
    },
    LPSTR lpCmdLine = &0,
    int nCmdShow = 1
)
004015AA  vlc.exe:004015AA  WinMain  winvlc.c:165
int WinMain(
    HINSTANCE hInstance = &{
        int i =
    },
    HINSTANCE hPrevInstance = &{
        int i = 14165825
    },
    LPSTR lpCmdLine = &'h',
    int nCmdShow = -1
)
0040124C  vlc.exe:0040124C
004012B8  vlc.exe:004012B8
7631E3F3  kernel32.dll:7631E3F3  BaseThreadInitThunk
77EACFED  ntdll.dll:77EACFED  RtlCreateUserProcess
77EAD1FF  ntdll.dll:77EAD1FF  RtlCreateProcessParameters
------------------------------------------------------------------------

Regards.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090307/426b9dbc/attachment.html>


More information about the vlc-devel mailing list