[Nagios-devel] nagios config check memory leak

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] nagios config check memory leak

Post by Guest »

I am currently running 3.2.3 and have found a set of configuration
files that results in a memory leak.

I have quite a few machines running nagios and all but one are running
happily with very similar configs (hosts/services differ from machine
to machine, but all other files are identical).

The short version of the problem (see the long version for Valgrind output)=
:
***************************************************************************=
*******
#### Snipit of hostgroup config file that doesn't work (identical on
all machines)
define hostgroup {
=A0=A0=A0 hostgroup_name Consumer Electronics
=A0=A0=A0 alias Consumer Electronics
}

#### running nagios -v ../nagios.cfg get this (please note, the
corrupt characters change every time I run the verify process)
.... lines ommited ....
=A0=A0=A0=A0=A0=A0=A0 Checked 15 hosts.
Checking host groups...
Error: Host '=E8=F0' specified in host group 'Consumer Electronics' is not
defined anywhere!
=A0=A0=A0=A0=A0=A0=A0 Checked 11 host groups.
.... lines ommited ....
Total Errors:=A0=A0 1

#### changing the "C" in consumer electronics to a "c" fixes it (or,
from a cursory check, any letters except "A", "B", or "C") - see
modified snipit
define hostgroup {
=A0=A0=A0 hostgroup_name consumer Electronics
=A0=A0=A0 alias Consumer Electronics
}

##### config check runs perfectly!!!

The longer version:
***************************************************************************=
***************
After seeing this problem, I recompiled nagios and installed using
"install-untstripped".
After that, I ran Valgrind against it and found some invalid reads.
Please see http://pastebin.com/JQYty7mb for the full output.

Part of the output is here:
Processing object config file '/usr/local/nagios/etc/globals/commands.cfg'.=
..
=3D=3D3640=3D=3D Invalid read of size 1
=3D=3D3640=3D=3D at 0x40E3FB7: strtok (in /lib/libc-2.5.so)
=3D=3D3640=3D=3D by 0x809E5C3: xodtemplate_register_objects (xodtemplate=
.c:9836)
=3D=3D3640=3D=3D by 0x80B3154: xodtemplate_read_config_data (xodtemplate=
.c:403)
=3D=3D3640=3D=3D by 0x8092F3A: read_object_config_data (objects.c:83)
=3D=3D3640=3D=3D by 0x8062D53: read_all_object_data (config.c:240)
=3D=3D3640=3D=3D by 0x80570DB: main (nagios.c:495)
=3D=3D3640=3D=3D Address 0x43851d0 is 16 bytes inside a block of size 17 f=
ree'd
=3D=3D3640=3D=3D at 0x402251D: free (vg_replace_malloc.c:325)
=3D=3D3640=3D=3D by 0x809FB89: xodtemplate_expand_hosts (xodtemplate.c:1=
4009)
=3D=3D3640=3D=3D by 0x80A2721: xodtemplate_expand_hostgroups_and_hosts
(xodtemplate.c:13734)
=3D=3D3640=3D=3D by 0x80A4686: xodtemplate_duplicate_objects (xodtemplat=
e.c:5563)
=3D=3D3640=3D=3D by 0x80B3326: xodtemplate_read_config_data (xodtemplate=
.c:359)
=3D=3D3640=3D=3D by 0x8092F3A: read_object_config_data (objects.c:83)
=3D=3D3640=3D=3D by 0x8062D53: read_all_object_data (config.c:240)
=3D=3D3640=3D=3D by 0x80570DB: main (nagios.c:495)
=3D=3D3640=3D=3D
=3D=3D3640=3D=3D Invalid read of size 1
=3D=3D3640=3D=3D at 0x40E3FDF: strtok (in /lib/libc-2.5.so)
=3D=3D3640=3D=3D by 0x809E5C3: xodtemplate_register_objects (xodtemplate=
.c:9836)
=3D=3D3640=3D=3D by 0x80B3154: xodtemplate_read_config_data (xodtemplate=
.c:403)
=3D=3D3640=3D=3D by 0x8092F3A: read_object_config_data (objects.c:83)
=3D=3D3640=3D=3D by 0x8062D53: read_all_object_data (config.c:240)
=3D=3D3640=3D=3D by 0x80570DB: main (nagios.c:495)
=3D=3D3640=3D=3D Address 0x43851d0 is 16 bytes inside a block of size 17 f=
ree'd
=3D=3D3640=3D=3D at 0x402251D: free (vg_replace_malloc.c:325)
=3D=3D3640=3D=3D by 0x809FB89: xodtemplate_expand_hosts (xodtemplate.c:1=
4009)
=3D=3D3640=3D=3D by 0x80A2721: xodtemplate_expand_hostgroups_and_hosts
(xodtemplate.c:13734)
=3D=3D3640=3D=3D by 0x80A4686: xodtemplate_duplicate_objects (xodtemplat=
e.c:5563)
=3D=3D3640=3D=3D by 0x80B3326: xodtemplate_read_config_data (xodtemplate=
.c:359)
=3D=3D3640=3D=3D by 0x8092F3A: read_object_config_data (objects.c:83)
=3D=3D3640=3D=3D by 0x8062D53: read_all_object_data (config.c:240)
=3D=3D3640=3D=3D

...[email truncated]...


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