2.0a1 SEGV on FreeBSD 4.x/Perl 5.005

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Thu Aug 19 12:05:46 CEST 2004


Dear Ladies and Gentelmen,

The problems with embedded Perl and Nagios 2.x seem to be platform 
specific since 2.0a1 builds and does a config check on Mac OS X.

(Thank you very much to Yuval Kogman for his making available OS X and 
Gentoo for me to poke around on).


However, there appears to be other issues with _compiling_ embedded 
Perl support in other systems.

1 Gentoo Linux

[pasta:~] anwsmh % uname -a
Linux pasta 2.6.7-gentoo-r11 #6 Wed Aug 11 17:34:36 IDT 2004 i686 AMD 
Athlon(tm) XP 2400+ AuthenticAMD GNU/Linux

1.1 with ePN

./configure  --enable-embedded-perl --with-perlcache ...

make all
cd ./base && make
make[1]: Entering directory `/home/anwsmh/build/nagios-cvs/base'
gcc -g -O2  -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  
-I/usr/lib/perl5/5.8.4/i386-linux-thread-multi/CORE  -DHAVE_CONFIG_H 
-DNSCORE -o nagios nagios.c broker.o nebmods.o checks.o config.o 
commands.o events.o flapping.o logging.o notifications.o sehandlers.o 
utils.o retention-base.o xretention-base.o comments-base.o 
xcomments-base.o objects-base.o xobjects-base.o statusdata-base.o 
xstatusdata-base.o perfdata-base.o xperfdata-base.o downtime-base.o 
xdowntime-base.o   -Wl,-export-dynamic   -rdynamic  -L/usr/local/lib 
/usr/lib/perl5/5.8.4/i386-linux-thread-multi/auto/DynaLoader/DynaLoader.a 
-L/usr/lib/perl5/5.8.4/i386-linux-thread-multi/CORE -lperl -lpthread 
-lnsl -ldl -lm -lcrypt -lutil -lc -lm -lnsl -lpthread -lltdl 

checks.o(.text+0x3f): In function `run_service_check':
/home/anwsmh/build/nagios-cvs/base/checks.c:123: undefined reference to 
`PL_thr_key'

utils.o(.text+0x2e59): In function `my_system':
/home/anwsmh/build/nagios-cvs/base/utils.c:1974: undefined reference to 
`PL_thr_key'

collect2: ld returned 1 exit status
make[1]: *** [nagios] Error 1
make[1]: Leaving directory `/home/anwsmh/build/nagios-cvs/base'
make: *** [all] Error 2

Ok this is almost certainly a Perl issue since symbol PL_thr_key is 
defined in the Perl headers (embedvars.h).

Given the machine owners private comments that he had trouble with 
vendor Perls but not after rebuilding Perl, this may be an optimisation 
issue with this Perl (and prob is since OS X is Ok).

1.2 without ePN

builds fine

2 Darwin OS X

[eris:~/build_TEMP_ONLY/nagios-cvs] anwsmh% uname -a
Darwin eris.woobling.org 8.0.0b1 Darwin Kernel Version 8.0.0b1: Mon Jun 
21 20:09:53 PDT 2004; root:xnu/xnu-634.obj~2/RELEASE_PPC  Power 
Macintosh powerpc

2.1 with ePN

[eris:~/build_TEMP_ONLY/nagios-cvs] anwsmh% make all
cd ./base && make
make[1]: Nothing to be done for `all'.
cd ./cgi && make
gcc -g -O2  -g -pipe -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp 
-fno-strict-aliasing -I/usr/local/include  
-I/System/Library/Perl/5.8.4/darwin-thread-multi-2level/CORE  
-DHAVE_CONFIG_H -DNSCGI  -o avail.cgi avail.c getcgi.o cgiutils.o 
cgiauth.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o 
xstatusdata-cgi.o 

ld: multiple definitions of symbol _last_command_check
cgiutils.o definition of _last_command_check in section (__DATA,__data)
xstatusdata-cgi.o definition of _last_command_check in section 
(__DATA,__common)

ld: multiple definitions of symbol _last_log_rotation
cgiutils.o definition of _last_log_rotation in section (__DATA,__data)
xstatusdata-cgi.o definition of _last_log_rotation in section 
(__DATA,__common)

make[1]: *** [avail.cgi] Error 1
make: *** [all] Error 2
[eris:~/build_TEMP_ONLY/nagios-cvs] anwsmh% 

2.2 without

.. gcc -g -O2 -DHAVE_CONFIG_H -DNSCGI  -o avail.cgi avail.c getcgi.o 
cgiutils.o cgiauth.o  objects-cgi.o xobjects-cgi.o statusdata-cgi.o 
xstatusdata-cgi.o 

all clean.

To sum up, it appears that there will be platform specific issues for 
embedding Perl in Nagios 2.0.

However, it seems likely that Nag 2.0 will embed contemporary Perls 
(5.6+) since while the CGIs won't compile on OS X, the Nag binary runs 
Ok.

Nick Ing-Simmon (perlxs list) says,
'Why not embed a threaded (perl5.6+ style) perl?
Note then even here you either need the mutex locks or every thread
needs to create its own perl instance.'

He should know.

FreeBSD 4.x users should probably try with the Perl 5.8.x port.

-- 
Stanley Hopcroft

Network specialist, IT Infrastructure
IP Australia
Ph: (02) 6283 3189  Fax: (02) 6281 1353
PO Box 200 Woden  ACT 2606
http://www.ipaustralia.gov.au


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285




More information about the Developers mailing list