You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Nick Kew <ni...@apache.org> on 2011/09/23 16:05:22 UTC

LoadFile?

I'm having some serious problems loading a plugin.

The plugin loads additional dynamic modules of its own.
This fails because the plugin's modules cannot see the
symbols exported by a library linked.

Explicitly dlopening the library fixes that problem,
but leaves the library loaded twice.  The result of
this is that static variables are uninitialised
when accessed from the plugin's modules.

HTTPD has none of those problems.  The key feature HTTPD
has that trafficserver lacks is the LoadFile directive
that loads a library with RTLD_GLOBAL and without any
kind of module initialisation (like traffiserver's
TSPluginInit).

I'd like to add an equivalent function and directive
to trafficserver.  Any comments and/or objections?


-- 
Nick Kew

Re: LoadFile?

Posted by Leif Hedstrom <zw...@apache.org>.
Would this be a new config file? Or an addition to some existing config? I guess this feature would also be useful when different plugins needs the same shared library? If so, would it be most intuitive to add it somehow to plugin.config, so these dependencies are all in one place?

-- Leif 

On Sep 23, 2011, at 8:05 AM, Nick Kew <ni...@apache.org> wrote:

> I'm having some serious problems loading a plugin.
> 
> The plugin loads additional dynamic modules of its own.
> This fails because the plugin's modules cannot see the
> symbols exported by a library linked.
> 
> Explicitly dlopening the library fixes that problem,
> but leaves the library loaded twice.  The result of
> this is that static variables are uninitialised
> when accessed from the plugin's modules.
> 
> HTTPD has none of those problems.  The key feature HTTPD
> has that trafficserver lacks is the LoadFile directive
> that loads a library with RTLD_GLOBAL and without any
> kind of module initialisation (like traffiserver's
> TSPluginInit).
> 
> I'd like to add an equivalent function and directive
> to trafficserver.  Any comments and/or objections?
> 
> 
> -- 
> Nick Kew

Re: LoadFile?

Posted by Nick Kew <ni...@apache.org>.
On Fri, 23 Sep 2011 15:17:22 -0000 (UTC)
Igor Galić <i....@brainsware.org> wrote:

> > I'd like to add an equivalent function and directive
> > to trafficserver.  Any comments and/or objections?
> 
> +1/encouragement
> 
> I think it's an excellent idea, I don't think it's something
> we can sensibly solve via TSPluginMechanisms()

FWIW, I just (since posting) hacked up a new plugin whose
sole purpose is to implement that.

Now to see whether it solves my original problem!

-- 
Nick Kew

Re: LoadFile?

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> I'm having some serious problems loading a plugin.
> 
> The plugin loads additional dynamic modules of its own.
> This fails because the plugin's modules cannot see the
> symbols exported by a library linked.
> 
> Explicitly dlopening the library fixes that problem,
> but leaves the library loaded twice.  The result of
> this is that static variables are uninitialised
> when accessed from the plugin's modules.
> 
> HTTPD has none of those problems.  The key feature HTTPD
> has that trafficserver lacks is the LoadFile directive
> that loads a library with RTLD_GLOBAL and without any
> kind of module initialisation (like traffiserver's
> TSPluginInit).
> 
> I'd like to add an equivalent function and directive
> to trafficserver.  Any comments and/or objections?

+1/encouragement

I think it's an excellent idea, I don't think it's something
we can sensibly solve via TSPluginMechanisms()

> --
> Nick Kew

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 571B 8B8A FC97 266D BDA3  EF6F 43AD 80A4 5779 3257