[vlc-devel] [PATCH] GSoC: lua services discovery, core part

Rémi Denis-Courmont remi at remlab.net
Wed Nov 25 11:31:50 CET 2009


On Tue, 24 Nov 2009 23:54:41 +0100, Fabio Ritrovato
<exsephiroth87 at gmail.com> wrote:
> 2009/11/9 Rémi Denis-Courmont <remi at remlab.net>:
>> I'm saying that you the module entry MUST return the EXACT SAME results
>> any time it is called during the lifetime of a VLC process. Otherwise
>> CacheMerge() can trigger crashes and weird errors. Hence your current
>> patch won't work.
>>
>> On top of that, working around the cache causes performance degration,
>> so it's best avoided. But that's only a secondary issue.
> 
> So, I was trying to find an alternative way of making it work without
> disabling the cache, but I can't find any issue with CacheMerge()...
> The module descriptor is only run once when vlc starts, and CacheMerge
> will use that data, so even if you were to add some scripts, hence
> "changing" the module descriptor, VLC wouldn't notice until the next
> start.

VLC always uses the cached plugin descriptor from the modules cache. It has
all the informations _except_ the callback pointers, as those cannot be
serialized into the modules cache.

When the plugin is dlopened(), VLC runs the plugin entry, which creates a
"real" plugin descriptor. Then VLC, it copies the callback pointers from
the real descriptor into the cached descriptor, and then it destroys the
real descriptor. The copy scheme is rather dumb. The number of submodules
and the order of submodules MUST be the same in the real and cached
descriptors. Obviously, if the module changes, this is not true.

If the descriptor has changed, undefined behavior occurs. We have already
had weird problems with this after earlier reworks of the plugins
subsystem.

-- 
Rémi Denis-Courmont




More information about the vlc-devel mailing list