nagios 1.1 SegFaults

Lombardo Federico egopfe at hotmail.com
Fri Jun 20 15:05:04 CEST 2003


I'm running debian 3.0r1

naguios will not generate a core also if runned into the built directory.

btw, I'm compiling with these general options:

General Options:

----------------------------------------------------------------------------
------------------------------

Nagios executable: nagios

Nagios user/group: nagios,nagios

Command user/group: nagios,nagios

Embedded Perl: yes, with caching

Install ${prefix}: /usr/local/nagios

Lock file: ${prefix}/var/nagios.lock

Init directory: /etc/init.d

Web Interface Options:

------------------------

HTML URL: http://localhost/nagios/

CGI URL: http://localhost/nagios/cgi-bin/

Traceroute (used by WAP): /usr/sbin/traceroute

External Data Routines:

------------------------

Status data: Database (MySQL)

Object data: Template-based (text file)

Comment data: Database (MySQL)

Downtime data: Database (MySQL)

Retention data: Database (MySQL)

Peformance data: Default (external commands)

Extended info data: Database (MySQL)

----------------------------------------------------------------------------
--------------------------------------------

When compiling nagios I can see this potential problem:

cc -g -O2 -I/usr/--enable-DEBUG3 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-st
rict-aliasing -D_LARGEFILE_SOURCE

-D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8.0/CORE -DHAVE_CONFIG_H -DNSCORE -
L/usr -lmysqlclient nagios.c checks.o

config.o commands.o flapping.o logging.o notifications.o sehandlers.o
utils.o sretention.o ../xdata/xrddb.c

../common/comments.c ../xdata/xcddb.c ../common/objects.c
../xdata/xodtemplate.c ../common/statusdata.c ../xdata/xsddb.c

perfdata.o ../xdata/xpddefault.c ../common/downtime.c

../xdata/xdddb.c -rdynamic -L/usr/local/lib
/usr/lib/perl/5.8.0/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl/5.8.0/CORE

-lperl -ldl -lm -lpthread -lc -lcrypt -lm -o nagios

nagios.c: In function `xs_init':

nagios.c:103: warning: passing arg 3 of `Perl_newXS' from incompatible
pointer type

nagios.c: In function `main':

nagios.c:634: warning: passing arg 2 of `perl_parse' from incompatible
pointer type

make[1]: Leaving directory `/root/nagios-1.1/base'





----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------------------------------------------------------------

My perl -V:

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:

Platform:

osname=linux, osvers=2.4.20-2.48smp, archname=i386-linux-thread-multi

uname='linux str'

config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -g -Dmyhostname=loca
lhost -Dperladmin=root at localhost -Dcc=gcc -Dcf_by=Red Hat,
Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix
=/usr -Dsiteprefix=/usr -Dotherlibdirs=/usr/lib/perl5/5.8.0 -Duseshrplib -Du
sethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -
Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallus
rbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr'

hint=recommended, useposix=true, d_sigaction=define

usethreads=define use5005threads=undef'

useithreads=define usemultiplicity=

useperlio= d_sfio=undef uselargefiles=define usesocks=undef

use64bitint=undef use64bitall=un uselongdouble=

usemymalloc=, bincompat5005=undef

Compiler:

cc='gcc', ccflags
='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-ali
asing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr
/include/gdbm',

optimize='',

cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-st
rict-aliasing -I/usr/local/include -I/usr/include/gdbm'

ccversion='', gccversion='3.2.2 20030213 (Red Hat Linux 8.0 3.2.2-1)',
gccosandvers=''

gccversion='3.2.2 200302'

intsize=e, longsize= , ptrsize=p, doublesize=8, byteorder=1234

d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12

ivtype='long'

k', ivsize=4'

ivtype='long'

known_ext, nvtype='double'

o_nonbl', nvsize=, Off_t='', lseeksize=8

alignbytes=4, prototype=define

Linker and Libraries:

ld='gcc'

l', ldflags =' -L/usr/local/lib'

ldf'

libpth=/usr/local/lib /lib /usr/lib

libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil

perllibs=

libc=/lib/libc-2.3.1.so, so=so, useshrplib=true, libperl=libper

gnulibc_version='2.3.1'

Dynamic Linking:

dlsrc=dl_dlopen.xs, dlext=so', d_dlsymun=undef,
ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/CORE'

cccdlflags='-fPIC'

ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5', lddlflags='s
Unicode/Normalize XS/A'



Characteristics of this binary (from libperl):

Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT

Locally applied patches:

MAINT18379

Built under linux

Compiled at Feb 18 2003 22:19:53

@INC:

/usr/lib/perl5/5.8.0/i386-linux-thread-multi

/usr/lib/perl5/5.8.0

/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi

/usr/lib/perl5/site_perl/5.8.0

/usr/lib/perl5/site_perl

/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi

/usr/lib/perl5/vendor_perl/5.8.0

/usr/lib/perl5/vendor_perl

/usr/lib/perl5/5.8.0/i386-linux-thread-multi

/usr/lib/perl5/5.8.0

.

----- Original Message ----- 
From: "Stanley Hopcroft" <Stanley.Hopcroft at IPAustralia.Gov.AU>
To: "Lombardo Federico" <egopfe at hotmail.com>
Cc: <nagios-users at lists.sourceforge.net>
Sent: Friday, June 20, 2003 1:44 PM
Subject: Re: [Nagios-users] nagios 1.1 SegFaults


> Dear Sir,
>
> I am writing to thank you for your letter and say,
>
> On Thu, Jun 19, 2003 at 04:13:02PM +0200, Lombardo Federico wrote:
> > My segfault does not generate a core.
>
> It probably would if you ran it in your build directory (./nagios -h or
> -m should do it).
>
> > Btw I've recompiled all without embeeded-perl support and now It never
> > segfault.
> >
>
> Please would you post the output of perl -V and the version of Debian
> you are using ? This should establish whether this is a new problem or
> not.
>
> > What to think ?
> >
>
> It is almost certainly the problem with threaded Perls (> 5.6.1 on Linux
> and Solaris) and embedding the Perl interpreter.
>
> The good news is that this is a known problem that is being fixed, if
> not has been fixed already.
>
> Yours sincerely.
>
> (Thanks for the strace; it's not very interesting is it. I think if you
> ran it under gdb
>
> gdb nagios
> set args -h
> .. SEGV ..
> and then bt
> you'd see the SEGV in perl_call_argv()
>
> )
>
> >
> > On Thursday 19 June 2003 12:59, Lombardo Federico wrote:
> > > I've correctly compiled and installed my Nagios 1.1 under my debian
> > running
> > > kernel 2.4.21, when I start with -v option, or without any option it i
> > > receive a segfault!
> > > Starting normal mode, -d /etc/nagios.cfg will work.
> > >
> > > Best Regards,
> > >
> > > Federico
> > >
> > > Here the strace process:
> > >
> > > execve("./nagios", ["./nagios"], [/* 15 vars */]) = 0
> > >
> > > uname({sys="Linux", node="tbox", ...}) = 0
> > >
> > > brk(0) = 0x8090ed0
> > >
> > > open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or
> > > directory)
> > >
> > > open("/etc/ld.so.cache", O_RDONLY) = 3
> > >
> > > fstat64(3, {st_mode=S_IFREG|0644, st_size=43905, ...}) = 0
> > >
> > > old_mmap(NULL, 43905, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40012000
> > >
> > > close(3) = 0
> > >
> > > open("/usr/lib/libmysqlclient.so.10", O_RDONLY) = 3
> > >
> > > read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\210\200"...,
> > 1024)
> > > = 1024
> > >
> > > fstat64(3, {st_mode=S_IFREG|0644, st_size=214344, ...}) = 0
> > >
> > > old_mmap(NULL, 213792, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
> > 0x4001d000
> > >
> > > mprotect(0x40039000, 99104, PROT_NONE) = 0
> > >
> > > old_mmap(0x40039000, 102400, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED,
> > > 3, 0x1c000) = 0x40039000
> > >
> > > close(3) = 0
> > >
> > > open("/usr/lib/libperl.so.5.8", O_RDONLY) = 3
> > >
> > > read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\370\366"...,
> > 1024)
> > > = 1024
> > >
> > > fstat64(3, {st_mode=S_IFREG|0644, st_size=1044008, ...}) = 0
> > >
> > > old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1,
> > > 0) = 0x40052000
> > >
> > > old_mmap(NULL, 1051328, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
> > > 0x40053000
> > >
> > > mprotect(0x40148000, 47808, PROT_NONE) = 0
> > >
> > > old_mmap(0x40148000, 40960, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED,
> > 3,
> > > 0xf5000) = 0x40148000
> > >
> > > old_mmap(0x40152000, 6848, PROT_READ|PROT_WRITE,
> > > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40152000
> > >
> > > close(3) = 0
> > >
> > > open("/lib/libdl.so.2", O_RDONLY) = 3
> > >
> > > read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0S\27\0\000"...,
> > > 1024) = 1024
> > >
> > > fstat64(3, {st_mode=S_IFREG|0644, st_size=7992, ...}) = 0
> > >
> > > old_mmap(NULL, 10924, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x40154000
> > >
> > > mprotect(0x40156000, 2732, PROT_NONE) = 0
> > >
> > > old_mmap(0x40156000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED, 3,
> > > 0x1000) = 0x40156000
> > >
> > > close(3) = 0
> > >
> > > open("/lib/libm.so.6", O_RDONLY) = 3
> > >
> > > read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\2605\0"...,
1024)
> > > = 1024
> > >
> > > fstat64(3, {st_mode=S_IFREG|0644, st_size=131156, ...}) = 0
> > >
> > > old_mmap(NULL, 133712, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
> > 0x40157000
> > >
> > > mprotect(0x40177000, 2640, PROT_NONE) = 0
> > >
> > > old_mmap(0x40177000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED, 3,
> > > 0x1f000) = 0x40177000
> > >
> > > close(3) = 0
> > >
> > > open("/lib/libpthread.so.0", O_RDONLY) = 3
> > >
> > > read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\224D\0"...,
1024)
> > > = 1024
> > >
> > > fstat64(3, {st_mode=S_IFREG|0644, st_size=81959, ...}) = 0
> > >
> > > old_mmap(NULL, 323104, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
> > 0x40178000
> > >
> > > mprotect(0x40184000, 273952, PROT_NONE) = 0
> > >
> > > old_mmap(0x40184000, 12288, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED,
> > 3,
> > > 0xc000) = 0x40184000
> > >
> > > old_mmap(0x40187000, 261664, PROT_READ|PROT_WRITE,
> > > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40187000
> > >
> > > close(3) = 0
> > >
> > > open("/lib/libc.so.6", O_RDONLY) = 3
> > >
> > > read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\275Z\1"...,
1024)
> > > = 1024
> > >
> > > fstat64(3, {st_mode=S_IFREG|0755, st_size=1103880, ...}) = 0
> > >
> > > old_mmap(NULL, 1113636, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
> > > 0x401c7000
> > >
> > > mprotect(0x402cf000, 32292, PROT_NONE) = 0
> > >
> > > old_mmap(0x402cf000, 24576, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED,
> > 3,
> > > 0x107000) = 0x402cf000
> > >
> > > old_mmap(0x402d5000, 7716, PROT_READ|PROT_WRITE,
> > > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x402d5000
> > >
> > > close(3) = 0
> > >
> > > open("/lib/libcrypt.so.1", O_RDONLY) = 3
> > >
> > > read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\t\0\000"...,
> > > 1024) = 1024
> > >
> > > fstat64(3, {st_mode=S_IFREG|0644, st_size=18120, ...}) = 0
> > >
> > > old_mmap(NULL, 180928, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
> > 0x402d7000
> > >
> > > mprotect(0x402dc000, 160448, PROT_NONE) = 0
> > >
> > > old_mmap(0x402dc000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED, 3,
> > > 0x4000) = 0x402dc000
> > >
> > > old_mmap(0x402dd000, 156352, PROT_READ|PROT_WRITE,
> > > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x402dd000
> > >
> > > close(3) = 0
> > >
> > > open("/lib/libz.so.1", O_RDONLY) = 3
> > >
> > > read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0D\30\0\000"...,
> > > 1024) = 1024
> > >
> > > fstat64(3, {st_mode=S_IFREG|0644, st_size=51352, ...}) = 0
> > >
> > > old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1,
> > > 0) = 0x40304000
> > >
> > > old_mmap(NULL, 50316, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x40305000
> > >
> > > mprotect(0x40310000, 5260, PROT_NONE) = 0
> > >
> > > old_mmap(0x40310000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED, 3,
> > > 0xb000) = 0x40310000
> > >
> > > close(3) = 0
> > >
> > > open("/lib/libnsl.so.1", O_RDONLY) = 3
> > >
> > > read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0d;\0\000"...,
> > 1024)
> > > = 1024
> > >
> > > fstat64(3, {st_mode=S_IFREG|0644, st_size=69132, ...}) = 0
> > >
> > > old_mmap(NULL, 76448, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x40312000
> > >
> > > mprotect(0x40322000, 10912, PROT_NONE) = 0
> > >
> > > old_mmap(0x40322000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED, 3,
> > > 0x10000) = 0x40322000
> > >
> > > old_mmap(0x40323000, 6816, PROT_READ|PROT_WRITE,
> > > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40323000
> > >
> > > close(3) = 0
> > >
> > > munmap(0x40012000, 43905) = 0
> > >
> > > getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY})
= 0
> > >
> > > setrlimit(RLIMIT_STACK, {rlim_cur=2044*1024, rlim_max=RLIM_INFINITY})
= 0
> > >
> > > getpid() = 10179
> > >
> > > rt_sigaction(SIGRTMIN, {0x4017fc2a, [], SA_RESTORER, 0x401ed9c8},
NULL, 8)
> > > = 0
> > >
> > > rt_sigaction(SIGRT_1, {0x4017fc62, [], SA_RESTORER, 0x401ed9c8}, NULL,
8)
> > =
> > > 0
> > >
> > > rt_sigaction(SIGRT_2, {0x4017fd15, [], SA_RESTORER, 0x401ed9c8}, NULL,
8)
> > =
> > > 0
> > >
> > > rt_sigprocmask(SIG_BLOCK, [RTMIN], NULL, 8) = 0
> > >
> > > _sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xbffff9dc, 32, (nil), 0}) = 0
> > >
> > > --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> > >
> > > +++ killed by SIGSEGV +++
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by: INetU
> > > Attention Web Developers & Consultants: Become An INetU Hosting
Partner.
> > > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly
Commission!
> > > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
> > > _______________________________________________
> > > Nagios-users mailing list
> > > Nagios-users at lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/nagios-users
> > >
> > > ::: Please include Nagios version, plugin version (-v) and OS when
> > > ::: reporting any issue. Messages without supporting info will risk
being
> > > ::: sent to /dev/null
> >
> > -- 
> > Roy Sigurd Karlsbakk, Datavaktmester
> > ProntoTV AS - http://www.pronto.tv/
> > Tel: +47 9801 3356
> >
> > Computers are like air conditioners.
> > They stop working when you open Windows.
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: INetU
> > Attention Web Developers & Consultants: Become An INetU Hosting Partner.
> > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
> > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
> > _______________________________________________
> > Nagios-users mailing list
> > Nagios-users at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/nagios-users
> > ::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue.
> > ::: Messages without supporting info will risk being sent to /dev/null
>
> -- 
> ------------------------------------------------------------------------
> Stanley Hopcroft
> ------------------------------------------------------------------------
>
> '...No man is an island, entire of itself; every man is a piece of the
> continent, a part of the main. If a clod be washed away by the sea,
> Europe is the less, as well as if a promontory were, as well as if a
> manor of thy friend's or of thine own were. Any man's death diminishes
> me, because I am involved in mankind; and therefore never send to know
> for whom the bell tolls; it tolls for thee...'
>
> from Meditation 17, J Donne.
>


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list