[Geany] "plugins" for plugins

Nick Treleaven nick.treleaven at xxxxx
Mon Jan 14 16:57:17 UTC 2008


On Mon, 14 Jan 2008 08:27:33 -0600
"Jeff Pohlmeyer" <yetanothergeek at gmail.com> wrote:

> On Jan 14, 2008 7:50 AM, Nick Treleaven
> <nick.treleaven at btinternet.com> wrote:
> > We needed to add it in r1734:
> > "Use G_MODULE_BIND_LOCAL for plugins to prevent symbol shadowing by
> > other modules, and to help detect unresolved symbols at loading
> > time."
> >
> > IIRC without it calling info() from within a plugin when > 1 plugins
> > were loaded without G_MODULE_BIND_LOCAL one of the plugins would
> > get the wrong plugin name.
> 
> Yes, I remember that conversation, but I thought we decided there
> wasn't  any real-world reason why a plugin would need to call its
> own  info() function.

But that was just one example of a name conflict. There could be other
name conflicts if more than one plugin was loaded without
G_MODULE_BIND_LOCAL.

> > I don't think we should allow any loading without it, because things
> > can silently go wrong.
> 
> I really wish you would reconsider it, the current

I'm not saying we definitely can't do it, just that I'm against it.
Apart from naming conflicts, G_MODULE_BIND_LOCAL also prevents loading
a plugin that tries to access an unresolved symbol. This can easily
happen when including a header that has an extern variables or
function declarations. Untested code would cause Geany to segfault.

I don't have much experience with dynamic modules. Is there really
no other way that the Lua plugin can load those modules for itself
only? Surely they shouldn't be shared with Geany and other plugins. Or
maybe I'm missing something?

Regards,
Nick



More information about the Users mailing list