Re: [Nagios-devel] Still problems with Nagios 2.9 and NDO

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Still problems with Nagios 2.9 and NDO

Post by Guest »


> >>> i'm still having problems with ndoutils under Solaris 9.
> >>> =20
> >>> When i'm activating it (event_broker_options=3D-1) in nagios.cfg
> >>> my nagios won't start anymore !! it always stops with a=20
> >> segmentation fault!
> >>> =20
> >>> here's the traceback of the dump:
> >>> =20
> >>> (gdb) bt
> >>> #0 0xff1b3288 in strlen () from /usr/lib/libc.so.1
> >>> #1 0xff10bcbc in ndo_escape_buffer (buffer=3DCannot access=20
> >> memory at address 0x44
> >>> ) at io.c:424
> >>> #2 0xff104788 in ndomod_write_object_config=20
> >> (config_type=3D1) at ndomod.c:3183
> >>> #3 0xff103d30 in ndomod_write_config (config_type=3D1) at=20
> >> ndomod.c:2999
> >>> #4 0xff103b44 in ndomod_broker_data (event_type=3D7,=20
> >> data=3D0xffbef954) at ndomod.c:2940
> >>> #5 0x0001d038 in neb_make_callbacks ()
> >>> #6 0x0001ca38 in broker_program_state ()
> >>> #7 0x0001b67c in main ()
> >>>
> >>> is there anyone who could shed a little lite on this ??
> >>> =20
> >> Not really. The program receives a SIGSEGV in=20
> >> ndo_escape_buffer because it gets
> >> passed an invalid pointer (memory address 0x44 is not=20
> >> available to programs).
> >>
> >> Why it gets passed a bogus address on Solaris is a mystery=20
> to me, as
> >> contact_struct->name is located at relative address 0 within=20
> >> the contact_struct
> >> data structure (unless your compiler re-arranges it ofcourse).
> >>
> > Hello Andreas,
> >=20
> > that's real funny.... i tried yesterday the same sources on a RHEL 4
> > system and it works perfectly !
> >=20
> > and also funny is that the SIGSEGV on Solaris 8 is there whether i
> > compile Nagios and NDO with gcc (4.1.2) or Sun-Studio 11 ...
> >=20
> > isn't there anyone who also has Nagios running on Solaris 8 ?? :-))
> >=20
>=20
> Probably, but it's unlikely that many of those run NDOUtils compiled
> with Solaris' compiler.
>=20
> --=20

Hello Andreas,

I'm not (totally) sure about this as i already tried to compile Nagios
and NDOUtils with SUN-Studio compilers (Studio 11 for Solaris 8) and
get the same results.

Maybe you remember one of my last mails (from April this year)...

> 1. error during compile: Solaris 8 doesn't provide the SUN_LEN macro, =
so i
> copied it from one of my Linux - systems ---> compile ok.
> 2. error during linking: Solaris 8 doesn't provide "strtof". I found =
the
> source for strtof on www.koders.com and added it ---> link ok

this is what i did:

1. add the following to include/config.h (for ndoutils):
#ifndef SUN_LEN
#define SUN_LEN(sunp) ((size_t)((struct sockaddr_un *)0)->sun_path + =
strlen((sunp)->sun_path))
#endif

2. add the following file to src (and add it to the makefile) to get =
"strtof":
bash-2.03# cat strtof.c
#include
#include
#include

float strtof(const char* s, char** endptr) {
register const char* p =3D s;
register float value =3D 0.;
int sign =3D +1;
float factor;
unsigned int expo;

while ( isspace(*p) )
p++;

switch (*p) {
case '-': sign =3D -1;
case '+': p++;
default : break;
}

while ( (unsigned int)(*p - '0') >=3D 1) =3D=3D 0 )
break;
factor *=3D factor;
}
}

done:
if ( endptr !=3D NULL )
*endptr =3D (char*)p;

return value * sign;
}


any ideas more? especially.... is my definition for SUN_LEN correct?
and... does anybody have a (maybe) better "strtof" for Solaris 8 ?

Thanks again!
Christian







This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked