[vlc-devel] commit: libvlccore: Don't do vout destruction before destroying playlist. ( Pierre d'Herbemont )

Pierre d'Herbemont pdherbemont at free.fr
Sun Jun 1 16:32:05 CEST 2008


On Jun 1, 2008, at 3:49 PM, Rémi Denis-Courmont wrote:

> Le Sunday 01 June 2008 01:20:29 git version control, vous avez écrit :
>> vlc | branch: master | Pierre d'Herbemont  
>> <pdherbemont at videolan.org> | Sun
>> Jun  1 00:19:11 2008 +0200|  
>> [a717f3bb306a96e04a1ef0993a4f379d307ffa49]
>>
>> libvlccore: Don't do vout destruction before destroying playlist.
>
> This is probably responsible for:
>
> ==7850==
> ==7850== Thread 1:
> ==7850== Invalid read of size 4
> ==7850==    at 0x424AFA6: pthread_spin_lock (pthread_spin_lock.c:35)
> ==7850==    by 0x40DAEDD: __vlc_object_yield (vlc_threads.h:496)
> ==7850==    by 0x406065E: __pl_Yield (control.c:48)
> ==7850==    by 0x40953F4: ??? (video_output.c:512)
> ==7850==    by 0x40DCE2E: __vlc_object_release (objects.c:340)
> ==7850==    by 0x4094473: vout_Destroy (video_output.c:487)
> ==7850==    by 0x404FABF: libvlc_InternalCleanup (libvlc.c:981)
> ==7850==    by 0x402C36E: libvlc_release (core.c:166)
> ==7850==    by 0x8048CB6: main (vlc.c:131)
> ==7850==  Address 0x527a02c is 52 bytes inside a block of size 404  
> free'd
> ==7850==    at 0x402265C: free (vg_replace_malloc.c:323)
> ==7850==    by 0x40DCF2F: __vlc_object_release (objects.c:410)
> ==7850==    by 0x404FA4D: libvlc_InternalCleanup (libvlc.c:969)
> ==7850==    by 0x402C36E: libvlc_release (core.c:166)
> ==7850==    by 0x8048CB6: main (vlc.c:131)
> ==7850==
>
> The playlist must be the penultimate destroyed object, otherwise  
> pl_Yield()
> will either assert or crash.

You can create an input hence a vout without using the playlist.  
Destroying the remaining vout before detroying the playlist means that  
you potentially can destroy a playlist's managed vout. (Leading to the  
crash we had previously when quitting libvlc.)

This is a dead end here. Either we remove vout-keep, and remove the  
need to destroy manually the vout when libvlc ends, or we remove the  
playlist dependency in the vout. I would opt for the second option, as  
this feel soundest IMO.

Pierre.




More information about the vlc-devel mailing list