[vlc-devel] commit: DBus : Fix a segfault when access->pf_control is NULL ( Rafaël Carré )

Rémi Denis-Courmont rdenis at simphalempin.com
Tue Mar 25 21:33:16 CET 2008


Le Tuesday 25 March 2008 12:19:47 Rafaël Carré, vous avez écrit :
> >  > DBus : Fix a segfault when access->pf_control is NULL
> >
> > I believe pf_control is mandatory. Please fix the broken plugins instead
> > of writing kludges.
>
> I put that on my TODO list.

I still don't see the point of this gross hack. It does not even seem to fix 
the problem - an access might as well set the pf_control callback _before_ 
it's ready - invoking Control before Open returns VLC_SUCCESS is simply 
broken; checking pf_control is pointless.

As far as I understand, there is a conflict with the two usages of the object 
tree (vlc_object_attach()). One usage is to make the object "find-able": the 
object should be attached _after_ it's initialized, and detached before it's 
destroyed. Another usage is to inherit variables: the object should be 
attached before it starts initializing, and detached after it's 
deinitialized.

In the particular case of the access objects, checking for p_access->p_module 
would work a lot better, except for locking. However, using callbacks (or 
variables) from a plugin from some foobar third party thread is anyway plain 
wrong. Most if not all plugins have no provision for re-entrancy whatsoever. 
Only the owner thread, i.e. the corresponding stream/input thread, should be 
allowed to do that.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list