[collectd] perl plugin woes

Richard Shade rshade at rightscale.com
Tue Mar 11 18:22:18 CET 2008


I have tested option 3. I get the following error:

Making all in libltdl
make[1]: Entering directory `/usr/src/redhat/SOURCES/collectd-4.3.1/libltdl'
make  all-am
make[2]: Entering directory `/usr/src/redhat/SOURCES/collectd-4.3.1/libltdl'
/bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
-DLT_LAZY_OR_NOW=RTLD_LAZY|RTLD_GLOBAL -c -o ltdl.lo ltdl.c
/bin/sh: RTLD_GLOBAL: command not found
libtool: compile: cannot determine name of library object from
`-DLT_LAZY_OR_NOW=RTLD_LAZY'
make[2]: *** [ltdl.lo] Error 127
make[2]: Leaving directory `/usr/src/redhat/SOURCES/collectd-4.3.1/libltdl'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/redhat/SOURCES/collectd-4.3.1/libltdl'
make: *** [all-recursive] Error 1

my configure statement is: ./configure
CFLAGS=-DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL' --prefix=/usr
--sbindir=/usr/sbin --mandir=/usr/share/man --libdir=/usr/lib
--sysconfdir=/etc --enable-apache --enable-email --enable-mysql --enable-dns



On 3/10/08, Sebastian Harl <sh at tokkee.org> wrote:
>
> Hi,
>
>
> On Sun, Mar 09, 2008 at 08:11:01PM -0700, Thorsten von Eicken wrote:
> > I'm having trouble getting the perl plugin to work on CentOS 5.0. As
> > soon as I put a LoadPlugin line into the perl conf section I get:
> >
> > [2008-03-09 23:02:22] perl: Initializing Perl interpreter...
> > /usr/sbin/collectd: symbol lookup error:
> > /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/IO/IO.so: undefined
> > symbol: Perl_Tstack_sp_ptr
>
>
> This is a know bug/problem with libtool/call it whatever you like. I
> guess this should be put in the FAQ or possibly the collectd-perl
> manpage...
>
> (Skip the following two paragraphs if you're not interested in the
> technical details.)
>
> Anyway, the problem is that, by default, libtool/libltdl only uses the
> RTDL_LAZY or RTDL_NOW flag when doing dlopen(3) and there is no (sane)
> way to tell libltdl to use any other flags. Now, when the perl plugin is
> loaded using lt_dlopen() (the dlopen wrapper provided by libltdl), the
> RTLD_LOCAL flag is used (that's the default in glibc and presumably
> other libc implementations) which causes all symbols defined in this
> library to not be made available to subsequently loaded libraries. As
> libperl is loaded as a dependency of the perl plugin, none of its
> symbols will be made available to subsequently loaded libraries either.
>
> Now, if you try to load a Perl module from a collectd Perl plugin which
> uses DynaLoader to load further libraries (like IO.so in this case) this
> library will depend on libperl as well. However, libperl has already
> been loaded before and the linker will not do so again but will be
> unable to resolve any symbols as they have not been made available
> before. This could be solved by using dlopen()'s RTLD_GLOBAL flag in the
> first place. Supposedly, this flag would cause libltdl not to be as
> portable as the developers want it to be and thus it's not supported.
>
> (I hope this did not get too confusing... ;-)
>
> There are four ways to solve this. The first two will probably take some
> time and require modifications of collectd. The latter ones are rather
> hacks but may be used now.
>
> 1. Do not use libtool/libltdl in collectd. We'd then have to take care
> of portable code ourselves. I did not have a look at that so far but I
> assume it's not trivial - else something like libtool would not be
> justified (well, we're in the OpenSource world, so basically anything is
> justified... ;-).
>
> 2. Wait for libtool to provide something like lt_dlopen_flags(). This
> has already been discussed on the developer's mailing list but I don't
> know the current state. collectd might not work on whatever platform(s)
> that do(es)n't support RTLD_GLOBAL then.
>
> 3. Use "LD_PRELOAD=/path/to/libperl collectd[mon]" to run collectd. This
> way, libperl is loaded at startup and all symbols will be made available
> to subsequently loaded libraries. I do not recommend this for any
> packages or the like though as it would fail, if libperl is not
> available.
>
> 4. Configure collectd using something like "./configure
> CFLAGS=-DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL'". This will overwrite
> the flags used by libltdl. That's what I'm currently using for the
> Debian package. I don't really like that but it's imho the best solution
> right now. You have to make sure that you're using the appropriate flags
> for your architecture - see the dlopen(3) manpage.
>
> Any feedback and comments would be very appreciated.
>
> HTH,
> Sebastian
>
>
> --
> Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/
>
> Those who would give up Essential Liberty to purchase a little Temporary
> Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFH1QbKEFEKc4UBx/wRAtbeAJ9w79sM1MbnkDKPwQpiJnVdftP5ZACfQ32F
> HN50Ro6CFjQmidf92OXegDI=
> =g57E
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> collectd mailing list
> collectd at verplant.org
> http://mailman.verplant.org/listinfo/collectd
>
>


-- 
Thanks,

Richard Shade
RightScale
http://www.rightscale.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.verplant.org/pipermail/collectd/attachments/20080311/a92d91b5/attachment.htm 


More information about the collectd mailing list