rlm_perl: ITHREADS --> solved

KES kes-kes at yandex.ru
Thu May 18 15:10:00 CEST 2006

Здравствуйте, Boian.

Вы писали 18 мая 2006 г., 11:14:13:

BJ> On Wed, May 17, 2006 at 05:02:28PM +0300, KES wrote:
>> I have try next program:
>> rlm_perl: perl_embed:: module = /usr/local/etc/raddb/kes.pl , func = authorize exit
>> status= Can't call method "prepare" on an undefined value at /usr/local/etc/raddb/kes.pl line 58.
As perl was without ITHERADS so sub CLONE was n't called and $dbh was
not initialized
sub CLONE {
 $dbh = DBI->connect("dbi:mysql:database=KES;host=",$user, $password);

sub authorize {
 my $query = $dbh->prepare(<<"QUERY"); #  Can't call method "prepare" on an undefined value at /usr/local/etc/raddb/kes.pl line 58

BJ> Did you check your script before using it with freeradius ? 
BJ> Maybe using the "use" directive will solve your problem ?

BJ> Check if your perl is compiled with ithreads.
BJ> perl -V | grep USE_ITHREADS

Yes, problem was with ITHREADS
# cd /usr/ports/lang/perl5.8
# make clean install clean WITH_THREADS=YES

but I see nothing executing "perl -V | grep USE_ITHREADS"
May be usage of ITHREADS showed by -D_THREAD_SAFE?

# perl -V
Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
    osname=freebsd, osvers=4.10-stable, archname=i386-freebsd-64int
    uname='freebsd kserv 4.10-stable freebsd 4.10-stable #11: sat oct 29 19:41:13 gmt 2005 kes at kserv:usrobjusrsrcsyskes_kern i386 '
    config_args='-sde -Dprefix=/usr/local -Darchlib=/usr/local/lib/perl5/5.8.7/mach -Dprivlib=/usr/local/lib/perl5/5.8.7 -Dman3dir=/usr/local/lib/perl5/5.8.7/perl/man/man3 -Dman1dir=/usr/local/man/man1 -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.7/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.8.7 -Dscriptdir=/usr/local/bin -Dsiteman3dir=/usr/local/lib/perl5/5.8.7/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dcc=cc -Duseshrplib -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.7/BSDPAN" -Doptimize=-O -pipe  -Ud_dosuid -Ui_gdbm -Dusethreads=n -Dusemymalloc=y -Duse64bitint'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=y, bincompat5005=undef
    cc='cc', ccflags ='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.7/BSDPAN" -D_THREAD_SAFE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include',
    optimize='-O -pipe ',
    cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.7/BSDPAN" -D_THREAD_SAFE -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='2.95.4 20020320 [FreeBSD]', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-pthread -Wl,-E -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-lgdbm -lm -lcrypt -lutil
    perllibs=-lm -lcrypt -lutil
    libc=, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -Wl,-R/usr/local/lib/perl5/5.8.7/mach/CORE'
    cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib'

Characteristics of this binary (from libperl):
  Compile-time options: USE_64_BIT_INT USE_LARGE_FILES
  Locally applied patches:
  Built under freebsd
  Compiled at Dec 27 2005 03:08:31

С уважением,
 KES                          mailto:kes-kes at yandex.ru

More information about the Freeradius-Users mailing list