[Nagiosplug-devel] [ nagiosplug-Bugs-2075933 ] check_disk segfault on freebsd 7 if using -p option
SourceForge.net
noreply at sourceforge.net
Wed Aug 19 14:35:37 CEST 2009
Bugs item #2075933, was opened at 2008-08-26 09:47
Message generated for change (Comment added) made by paulolange
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=2075933&group_id=29880
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General plugin execution
Group: snapshot tarball
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Stefano Coletta (creatore)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_disk segfault on freebsd 7 if using -p option
Initial Comment:
By using check_disk plugin on FreeBSD 7 with -p option it causes a segfault.
The latest head CVS does not fix the problem.
[root at server /usr/local/nagios/libexec]# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -vvv -p /var
For /var, total=1512775, available=1382811, available_to_root=1503833, used=8942, fsp.fsu_files=400382, fsp.fsu_ffree=398157
For /var, used_pct=1 free_pct=99 used_units=17 free_units=2700 total_units=2954 used_inodes_pct=1 free_inodes_pct=99 fsp.fsu_blocksize=2048 mult=1048576
Freespace_units result=0
Freespace% result=0
Usedspace_units result=0
Usedspace_percent result=0
Usedinodes_percent result=0
Segmentation fault: 11 (core dumped)
I've found that the segfault happens at this line on t he check_disk.c:
359: temp_result = get_status(dfree_inodes_percent, path->freeinodes_percent);
[root at server /usr/local/nagios/libexec]# /usr/local/nagios/libexec/check_disk -V
check_disk v1991 (nagios-plugins 1.4.12)
[root at server /]# uname -a
FreeBSD server.***.** 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008 root at logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
[root at server /]# gcc -v
Using built-in specs.
Target: i386-undermydesk-freebsd
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070719 [FreeBSD]
----------------------------------------------------------------------
Comment By: Paulo Lange (paulolange)
Date: 2009-08-19 08:35
Message:
Hi. I have the same problem.
# ./check_disk -w 20% -c 10% -vvv -p /var
calling stat on /var
calling stat on /var
For /, total=75431085, available=62550318, available_to_root=68584804,
used=6846281, fsp.fsu_files=19501054, fsp.fsu_ffree=18963514
For /, used_pct=10 free_pct=90 used_units=13371 free_units=122168
total_units=147326 used_inodes_pct=3 free_inodes_pct=97
fsp.fsu_blocksize=2048 mult=1048576
Freespace_units result=0
Freespace% result=0
Usedspace_units result=0
Usedspace_percent result=0
Usedinodes_percent result=0
Segmentation fault
----------------------------------------------------------------------
Comment By: Stefano Coletta (creatore)
Date: 2008-08-27 05:00
Message:
Logged In: YES
user_id=327996
Originator: YES
rtp# gdb plugins/check_disk
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i386-marcel-freebsd"...
(gdb) run -w 20% -c 10% -vvv -p /var
Starting program:
/usr/home/*******/nagios-plugins-1.4.12/plugins/check_disk -w 20% -c 10%
-vvv -p /var
For /var, total=1512775, available=1382783, available_to_root=1503805,
used=8970, fsp.fsu_files=400382, fsp.fsu_ffree=398149
For /var, used_pct=1 free_pct=99 used_units=17 free_units=2700
total_units=2954 used_inodes_pct=1 free_inodes_pct=99
fsp.fsu_blocksize=2048 mult=1048576
Freespace_units result=0
Freespace% result=0
Usedspace_units result=0
Usedspace_percent result=0
Usedinodes_percent result=0
Program received signal SIGSEGV, Segmentation fault.
check_range (value=99, my_range=0x424d) at utils_base.c:168
168 if (my_range->alert_on == INSIDE) {
(gdb) bt
#0 check_range (value=99, my_range=0x424d) at utils_base.c:168
#1 0x0804cf83 in get_status (value=99, my_thresholds=0x2820b0ac) at
utils_base.c:201
#2 0x0804b405 in main (argc=Error accessing memory address 0x0: Bad
address.
) at check_disk.c:359
----------------------------------------------------------------------
Comment By: Thomas Guyot-Sionnest (dermoth)
Date: 2008-08-26 21:31
Message:
Logged In: YES
user_id=375623
Originator: NO
Hi,
Given the line you mentioned, it looks more like the segfault happened
inside the get_status() function because temp_result is an integer. Could
you try getting a backtrace from gdb? Run it from the source tree of
nagios-plugins if possible. i.e.:
$ gdb plugins/check_disk
(gdb) run -w 20% -c 10% -vvv -p /var
<Segfault should happen here>
(gdb) bt
And sent the full output of gdb.
Thanks
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=2075933&group_id=29880
More information about the Devel
mailing list