[Nagios-devel] 2.0a1 and embedded-perl

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

[Nagios-devel] 2.0a1 and embedded-perl

Post by Guest »

We'll I've about reached the limit of what my amateurish C debugging
skills can accomplish. :)=20

Basically the problem is that if I compile nagios with
--enable-embedded-perl it hangs with a nagios zombie process. No checks
are ever run. Compiling it without, everything rolls along just great.

With strace I can see where it's happening. This is while it's trying to
run the check_disk plugin

[pid 6247] pipe([5, 9]) =3D 0
[pid 6247] vfork() =3D 6248
[pid 6248] close(5) =3D 0
[pid 6248] dup2(9, 1) =3D 1
[pid 6248] close(9) =3D 0
[pid 6248] write(8,
"\240\240\33@\2\0\0\0\0\0\0\0\376\360\32@\f3\32@\200[\27\10X\271\377\277
aU\17@\260\23\32@\240\17\32@X\271\3
77\277HU\17@turkish\0 "..., 148) =3D 148
[pid 6244] [{fd=3D7, events=3DPOLLIN, =
revents=3DPOLLIN}],
1, 2000) =3D 1
[pid 6248] rt_sigprocmask(SIG_SETMASK, NULL,
[pid 6244] getppid(
[pid 6248] [RTMIN], 8) =3D 0
[pid 6244] ) =3D 6243
[pid 6248] rt_sigsuspend([]
[pid 6244] read(7,
"\240\240\33@\2\0\0\0\0\0\0\0\376\360\32@\f3\32@\200[\27\10X\271\377\277
aU\17@\260\23\32@\240\17\32@X\271\37
7\277HU\17@turkish\0 "..., 148) =3D 148
[pid 6244] kill(6245, SIGRT_1) =3D 0
[pid 6245] [{fd=3D5, events=3DPOLLIN}], 1, 500) =3D =
-1
EINTR (Interrupted system call)
[pid 6245] --- SIGRT_1 (Real-time signal 1) ---
[pid 6245] _exit(0) =3D ?
[pid 6244] --- SIGRT_1 (Real-time signal 1) ---
[pid 6244] sigreturn() =3D ? (mask now ~[TRAP KILL =
STOP])
[pid 6244] wait4(6245,
[pid 6246] close(6
[pid 6247] close(9
[pid 6246] ) =3D 0
[pid 6247] ) =3D 0
[pid 6246] _exit(0) =3D ?
[pid 6247] fstat64(5,
[pid 6243] NULL, 0, NULL) =3D 6246
[pid 6243] --- SIGCHLD (Child exited) ---
[pid 6243] time([1079656326]) =3D 1079656326
[pid 6243] nanosleep({0, 250000000},
[pid 6247] {st_mode=3DS_IFIFO|0600, st_size=3D0,
...}) =3D 0
[pid 6247] old_mmap(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =3D 0x40013000
[pid 6247] read(5,

And that's it. Pid 6247 just waits there.=20

Looking at the code; it seems to hang in base/checks.c line 431, the
first fgets on the process.

Now with embedded turned off I get this:

[pid 8845] pipe([4, 6]) =3D 0
[pid 8845] fork() =3D 8846
[pid 8846] getpid() =3D 8846
[pid 8846] getrlimit(0x3, 0xbfffccc0) =3D 0
[pid 8846] close(4) =3D 0
[pid 8846] dup2(6, 1) =3D 1
[pid 8846] close(6) =3D 0
[pid 8846] getpid() =3D 8846
[pid 8846] getrlimit(0x3, 0xbfffbb20) =3D 0
[pid 8846] rt_sigaction(SIGRTMIN, {SIG_DFL}, NULL, 8) =3D 0
[pid 8846] rt_sigaction(SIGRT_1, {SIG_DFL}, NULL, 8) =3D 0
[pid 8846] rt_sigaction(SIGRT_2, {SIG_DFL}, NULL, 8) =3D 0
[pid 8846] execve("/bin/sh", ["sh", "-c",
"/usr/lib/nagios/plugins/check_http -H 192.169.1.6"], [/* 25 vars */]) =
=3D
0

etc, etc.

What I got stuck on was why popen seemed to call fork() when compiled
without and then vfork() when compiled with embedded perl on. Shouldn't
they be the same since check_http and check_disk aren't written in perl?

Last note is that if I expanded the strace width I could read a funky
looking error message which the forked process seemed to spit out.

[pid 12217] write(8,
"\240\240\33@\2\0\0\0\0\0\0\0\376\360\32@\f3\32@\200[\27\10\330\305\377\
277aU\17@\260\23\32@\240\17\32@\330
\305\377\277HU\17@turkish\0
\374\226\32@p\306\377\277\10f\0@\23\253\32@\240\332\10@\0\n\nuBd\0@ the
`glibcbug\' scriX\306\377
\277o\n\0re\n\0\0\374\226\32@\1\0\0\0\336\262\32@l\243\32@\34\217\32@\22
0\313\2@\t\0\0\0", 148) =3D 148

This is a stock redha

...[email truncated]...


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