Modify

Opened 8 years ago

Closed 8 years ago

#5015 closed defect (fixed)

nagios-plugins / segmentation fault

Reported by: vic Owned by: developers
Priority: normal Milestone: Kamikaze 8.09.2
Component: packages Version: Kamikaze 8.09
Keywords: Cc:

Description

I have here some troubles with the nagios plugins on kamikaze 8.09 release.

I use a ASUS wl-500gPv1 router with kamikaze 8.09 and nagios-plugins 1.4.12-1.

when I use the command check_ping I get an error: segmentation fault.
do I need install additional packages or is it a bug?

Attachments (0)

Change History (8)

comment:1 Changed 8 years ago by vic

here is a strace log:

root@test:/usr/libexec/nagios# ./check_ping -H 192.168.1.1 -w 20%,500.0 -c 100%,1000.0 -p 1
Segmentation fault
root@test:/usr/libexec/nagios# strace ./check_ping -H 192.168.1.1 -w 20%,500.0 -c 100%,1000.0 -p 1
execve("./check_ping", ["./check_ping", "-H", "192.168.1.1", "-w", "20%,500.0", "-c", "100%,1000.0", "-p", "1"], 9 vars */) = 0
old_mmap(NULL, 20, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0) = 0x2aaad000
stat("/etc/ld.so.cache", 0x7fff79f0) = -1 ENOENT (No such file or directory)
open("", O_RDONLY) = 3
fstat(3, {st_mode=0, st_size=4104, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\240\3\0\0004\0\0\0\0"..., 4096) = 4096
old_mmap(NULL, 270336, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0) = 0x2aaee000
old_mmap(0x2aaee000, 980, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 0, 0) = 0x2aaee000
old_mmap(0x2ab2f000, 8, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x2ab2f000
close(3) = 0
munmap(0x2aaae000, 4096) = 0
open("/lib/lib\30r\377\177", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=4104, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\240\3\0\0004\0\0\0\0"..., 4096) = 4096
old_mmap(NULL, 270336, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, 3, 0) = 0x2ab30000
old_mmap(0x2ab30000, 980, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2ab30000
old_mmap(0x2ab71000, 8, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x2ab71000
close(3) = 0
munmap(0x2aaae000, 4096) = 0
open("/lib/lib\10r\377\177$\254\252*/lib/libresolv.so.0", O_RDONLY) = 3
fstat(3, {st_mode=0, st_size=8366, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0p\10\0\0004\0\0\0\0"..., 4096) = 4096
old_mmap(NULL, 274432, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, 3, 0) = 0x2ab72000
old_mmap(0x2ab72000, 6496, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 716374016, 0x7fff7078) = 0x2ab72000
old_mmap(0x2abb3000, 4270, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 715838060, 0x2aaad254) = 0x2abb3000
close(3) = 0
munmap(0x2aaae000, 4096) = 0
open("/lib/libgcc_s.so.1", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=59002, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\360\27\0\0004\0\0\0\0"..., 4096) = 4096
old_mmap(NULL, 323584, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2abb5000
old_mmap(0x2abb5000, 56932, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2abb5000
old_mmap(0x2ac03000, 1658, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 715838352, 0x2aaad378) = 0x2ac03000
close(3) = 0
munmap(0x2aaae000, 4096) = 0
open("/lib/libc.so.0", O_RDONLY) = 3
fstat(3, {st_mode=0, st_size=405559, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\240\247\0\0004\0\0\0\0"..., 4096) = 4096
old_mmap(NULL, 688128, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ac04000
old_mmap(0x2ac04000, 399300, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 716918784, 0x7fff7058) = 0x2ac04000
old_mmap(0x2aca5000, 8247, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x61000) = 0x2aca5000
old_mmap(0x2aca8000, 15504, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 715825072, 0x2ab3012c) = 0x2aca8000
close(3) = 0
munmap(0x2aaae000, 4096) = 0
open("\364\320\256*H|\377\177\330q\377\177$\254\252*/lib/libc.so.0", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
close(3) = 0
open("/lib/lib\350y\377\177$\254\252*\364\320\256*H|\377\177c.so.0", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=405559, ...}) = 0
close(3) = 0
open("/lib/libc.so.0", O_RDONLY) = 3
fstat(3, {st_mode=0, st_size=405559, ...}) = 0
close(3) = 0
open("/lib/lib\250q\377\177$\254\252*/lib/libc.so.0", O_RDONLY) = 3
fstat(3, {st_mode=0, st_size=405559, ...}) = 0
close(3) = 0
stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=20694, ...}) = 0
mprotect(0x2abb3000, 4096, PROT_READ) = 0
mprotect(0x2aca5000, 4096, PROT_READ) = 0
mprotect(0x2aaec000, 4096, PROT_READ) = 0
ioctl(0, TIOCNXCL, {B0 -opost -isig -icanon -echo ...}) = 0
ioctl(1, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0
brk(0) = 0x448440
brk(0x449440) = 0x449440
brk(0x44a000) = 0x44a000
rt_sigaction(SIGALRM, {0x10000000, [], 0x405134 /* SA_??? */}, {SIG_DFL, [], 0}, 16) = 0
alarm(11) = 0
ioctl(2147483647, TIOCNXCL, 0x7fff7b50) = -1 EBADF (Bad file descriptor)
brk(0x44b000) = 0x44b000
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

comment:2 Changed 8 years ago by nico

  • Milestone changed from Kamikaze to Kamikaze 8.09.1

Confirmed on UML

comment:3 Changed 8 years ago by mvalsasna@…

similar issue on x86/soekris net5501

will try patch in https://dev.openwrt.org/changeset/15193

logread shows:

May 15 15:42:01 (none) user.info kernel: check_ping[1867]: segfault at 4 ip b7f938fa sp bfbccc00 error 4 in libuClibc-0.9.29.so[b7f6c000+44000]

strace:


# strace /usr/libexec/nagios/check_ping -H 192.168.1.2 -w 100,20% -c 200,80% -p 4 -t 4
execve("/usr/libexec/nagios/check_ping", ["/usr/libexec/nagios/check_ping", "-H", "192.168.1.2", "-w", "100,20%", "-c", "200,80%", "-p", "4", "-t", "4"], [/* 9 vars */]) = 0
mmap2(NULL, 20, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa5000
stat("/etc/ld.so.cache", 0xbfbaadf0)    = -1 ENOENT (No such file or directory)
open("/lib/libnsl.so.0", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=4086, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa4000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\f\2\0\0004\0\0\0"..., 4096) = 4086
mmap2(NULL, 8192, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa2000
mmap2(0xb7fa2000, 552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7fa2000
mmap2(0xb7fa3000, 4086, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7fa3000
close(3)                                = 0
munmap(0xb7fa4000, 4096)                = 0
open("/lib/libresolv.so.0", O_RDONLY)   = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=4086, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa4000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\2\0\0004\0\0\0"..., 4096) = 4086
mmap2(NULL, 8192, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa0000
mmap2(0xb7fa0000, 556, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7fa0000
mmap2(0xb7fa1000, 4086, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7fa1000
close(3)                                = 0
munmap(0xb7fa4000, 4096)                = 0
open("/lib/libdl.so.0", O_RDONLY)       = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=8238, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa4000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220\7\0\0004\0\0\0"..., 4096) = 4096
mmap2(NULL, 16384, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f9c000
mmap2(0xb7f9c000, 4766, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7f9c000
mmap2(0xb7f9e000, 4142, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1) = 0xb7f9e000
close(3)                                = 0
munmap(0xb7fa4000, 4096)                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=31974, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa4000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0H\25\0\0004\0\0\0"..., 4096) = 4096
mmap2(NULL, 36864, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f93000
mmap2(0xb7f93000, 31592, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7f93000
mmap2(0xb7f9b000, 3302, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x7) = 0xb7f9b000
close(3)                                = 0
munmap(0xb7fa4000, 4096)                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=279741, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7fa4000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220\251\0\0004\0\0\0"..., 4096) = 4096
mmap2(NULL, 307200, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f48000
mmap2(0xb7f48000, 275112, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7f48000
mmap2(0xb7f8c000, 5309, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x43) = 0xb7f8c000
mmap2(0xb7f8e000, 16988, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f8e000
close(3)                                = 0
munmap(0xb7fa4000, 4096)                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=279741, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=279741, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=279741, ...}) = 0
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=279741, ...}) = 0
close(3)                                = 0
stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=16390, ...}) = 0
mprotect(0xb7fa3000, 4096, PROT_READ)   = 0
mprotect(0xb7fa1000, 4096, PROT_READ)   = 0
mprotect(0xb7f9e000, 4096, PROT_READ)   = 0
mprotect(0xb7f8c000, 4096, PROT_READ)   = 0
mprotect(0xb7faa000, 4096, PROT_READ)   = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
brk(0)                                  = 0x9d6e000
brk(0x9d6f000)                          = 0x9d6f000
rt_sigaction(SIGALRM, {0x804bdc0, [ALRM], SA_RESTORER|SA_RESTART, 0xb7f529e8}, {SIG_DFL}, 8) = 0
alarm(5)                                = 0
brk(0x9d70000)                          = 0x9d70000
ioctl(2147483647, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfbaaf24) = -1 EBADF (Bad file descriptor)
brk(0x9d71000)                          = 0x9d71000
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

comment:4 Changed 8 years ago by mvalsasna@…

no way: patched the uclibc source, rebuilt the imagebuilder, rebuilt the image, installed

same segfault

PS: any way to check that I am actually using the patched uclibc?

comment:5 Changed 8 years ago by mvalsasna@…

apparently not the same uclibc bug as in https://dev.openwrt.org/ticket/4915: bug description in https://dev.openwrt.org/attachment/ticket/4915/asterisk-1.4.x-remove-daemon-hack.diff says:

workaround for uClibc-0.9.29 mipsel bug: 
recursive mutexes do not work if uClibc daemon() function has been called, 
  if parent thread locks a mutex 
  the child thread cannot acquire a lock with the same name 
  (same code works if daemon() is not called) 
but duplication of uClibc daemon.c code in here does work.


but nagios-plugins code does not use daemon()

comment:6 Changed 8 years ago by nico

  • Milestone changed from Kamikaze 8.09.1 to Kamikaze 8.09.2

comment:7 Changed 8 years ago by vic

has anyone a solution to resolve this problem?

comment:8 Changed 8 years ago by nico

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [17851], thanks!

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.