[vlc-devel] reenabling java bindings
olivier.aubert at liris.cnrs.fr
Fri Dec 12 16:08:49 CET 2008
On Fri, 2008-12-12 at 14:33 +0100, Rémi Denis-Courmont wrote:
> > There's surely something I'm missing in the way java loads libraries,
> > since checking the java source code I've seen it uses dlopen (are there
> > any other means to load a library?).
> Link at build time, and let the run-time linker do the job.
> That's how VLC loads libvlc, and how libvlc loads libvlccore.
libvlc does not dlopen(libvlccore) explicitly. libtool does its job, and
libvlc is simply compiled against -lvlccore, which the loader resolves
With your approach, all other mentionned systems (java bindings, python
bindings, mozilla plugin) should have to explicitly load libvlcore with
if (!dlopen ("libvlccore.so", RTLD_NOW | RTLD_GLOBAL))
printf ("\n%s\n", dlerror());
(with an additional #define to use .dll instead of .so for windows, etc).
so that libvlccore symbols are available for subsequently loaded vlc modules.
It is not undoable, but looks hackish to me: since plugins use symbols
from libvlccore, we should simply link them with libvlccore, not rely on
user code to do that.
> > So I ask to make that plugin linking against libvlccore configurable
> > with a specific switch from configure and disabled by default, until
> > loading from java is sorted out (I locally reverted the changes on that
> > commit, and the java bindings work again as expected). I will proceed
> > with this modification after a general agreement on this change.
> I disagree. The way plugins link back into libvlccore makes this approach
> fundamentally unsafe: a plugin must link against the libvlccore image that
> loaded the plugin. We have had multiple reports of obnoxious crashes due to
> that, and that's not counting those people who ran away without bothering
> to report the problem.
I would be curious to have explicit references to such "multiple reports
of obnoxious crashes due to that". Not that I question your affirmation,
but I would like to investigate the issue to better understand its
More information about the vlc-devel