#577 check_mysql segfault

release-1.4.15
open
nobody
5
2012-10-23
2012-10-23
miai
No

Plugin Version: check_mysql v1.4.16 (nagios-plugins 1.4.16)
Plugin Name: check_mysql
Plugin Commandline showing issues: check_mysql --check-slave -s /tmp/mysql.sock --user=nagios_check --password=foo -w 60 -c 1200
Operating System: Solaris 10
Architecture: amd64

check_mysql segfaults when replication on the Mysql server is stopped and check_mysql is called with --check-slave option.

This is the output of truss (the last lines before the crash).

open64("/opt/local/share/mysql/charsets/Index.xml", O_RDONLY) = 6
read(6, " < ? x m l v e r s i o".., 18173) = 18173
close(6) = 0
brk(0x0806A538) = 0
brk(0x0806C538) = 0
write(5, " B\0\00185A2\0\0\0\0\0 @".., 70) = 70
read(5, "07\0\002\0\0\002\0\0\0", 16384) = 11
pollsys(0x080474B4, 1, 0x08047490, 0x00000000) = 0
write(5, "01\0\0\0\t", 5) = 5
read(5, "A0\0\001 U p t i m e : ".., 16384) = 164
pollsys(0x08047464, 1, 0x08047440, 0x00000000) = 0
write(5, "12\0\0\003 s h o w s l".., 22) = 22
read(5, "01\0\001 ! $\0\00203 d e".., 16384) = 1576
Incurred fault #6, FLTBOUNDS %pc = 0xFE7663DC
siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
Received signal #11, SIGSEGV [default]
siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000

When the replication is running the check finishes ok:

read(5, "A1\0\001 U p t i m e : ".., 16384) = 165
pollsys(0x08047464, 1, 0x08047440, 0x00000000) = 0
write(5, "12\0\0\003 s h o w s l".., 22) = 22
read(5, "01\0\001 ! $\0\00203 d e".., 16384) = 1611
pollsys(0x080474A4, 1, 0x08047480, 0x00000000) = 0
write(5, "01\0\0\001", 5) = 5
shutdown(5, SHUT_RDWR, SOV_DEFAULT) = 0
close(5) = 0
ioctl(1, TCGETA, 0x080466A4) = 0
fstat64(1, 0x08046610) = 0
Uptime: 24536459 Threads: 11 Questions: 6560661791 Slow queries: 295912811 Opens: 474612 Flush tables: 1 Open tables: 1024 Queries per second avg: 267.384 Slave IO: Yes Slave SQL: Yes Seconds Behind Master: 0
write(1, " U p t i m e : 2 4 5 3".., 216) = 216
_exit(0)

same behaviour with 1.4.14/15/16
same with self compiled plugin and with NRPE package from Opsview (ALTovagent)

Discussion