[Nagios-devel] NSCA 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] NSCA memory leak

Post by Guest »

Hi list,

I am running nagios on Gentoo and having an issue with NSCA.

When NSCA is running for a few days I get it crashes with this in dmesg:

localhost nsca[6030]: segfault at ffffffffff600429 ip 00007f8d3ea19dfc sp
00007fff47281350 error 7 in libwrap.so.0.7.6[7f8d3ea16000+8000]

I compiled NSCA in debug mode and ran it with valgrind. We found the =20
following memory
leak:

=3D=3D8837=3D=3D Syscall param fcntl(arg) contains uninitialised byte(s)
=3D=3D8837=3D=3D at 0x553EF5B: fcntl (in /lib64/libc-2.9.so)
=3D=3D8837=3D=3D by 0x402FE1: handle_connection (in /usr/bin/nsca)
=3D=3D8837=3D=3D by 0x403369: accept_connection (in /usr/bin/nsca)
=3D=3D8837=3D=3D by 0x4040D5: main (in /usr/bin/nsca)
=3D=3D8840=3D=3D
=3D=3D8840=3D=3D Syscall param fcntl(arg) contains uninitialised byte(s)
=3D=3D8840=3D=3D at 0x553EF5B: fcntl (in /lib64/libc-2.9.so)
=3D=3D8840=3D=3D by 0x402FE1: handle_connection (in /usr/bin/nsca)
=3D=3D8840=3D=3D by 0x403369: accept_connection (in /usr/bin/nsca)
=3D=3D8840=3D=3D by 0x4040D5: main (in /usr/bin/nsca)
=3D=3D8842=3D=3D
=3D=3D8842=3D=3D Syscall param fcntl(arg) contains uninitialised byte(s)
=3D=3D8842=3D=3D at 0x553EF5B: fcntl (in /lib64/libc-2.9.so)
=3D=3D8842=3D=3D by 0x402FE1: handle_connection (in /usr/bin/nsca)
=3D=3D8842=3D=3D by 0x403369: accept_connection (in /usr/bin/nsca)
=3D=3D8842=3D=3D by 0x4040D5: main (in /usr/bin/nsca)
=3D=3D8838=3D=3D
=3D=3D8838=3D=3D Syscall param fcntl(arg) contains uninitialised byte(s)
=3D=3D8838=3D=3D at 0x553EF5B: fcntl (in /lib64/libc-2.9.so)
=3D=3D8838=3D=3D by 0x402FE1: handle_connection (in /usr/bin/nsca)
=3D=3D8838=3D=3D by 0x403369: accept_connection (in /usr/bin/nsca)
=3D=3D8838=3D=3D by 0x4040D5: main (in /usr/bin/nsca)
=3D=3D8828=3D=3D
=3D=3D8828=3D=3D ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 14 fro=
m 2)
=3D=3D8828=3D=3D malloc/free: in use at exit: 621 bytes in 25 blocks.
=3D=3D8828=3D=3D malloc/free: 115 allocs, 90 frees, 32,290 bytes allocated.
=3D=3D8828=3D=3D For counts of detected errors, rerun with: -v
=3D=3D8828=3D=3D Use --track-origins=3Dyes to see where uninitialised values=
come from
=3D=3D8828=3D=3D searching for pointers to 25 not-freed blocks.
=3D=3D8828=3D=3D checked 124,080 bytes.
=3D=3D8828=3D=3D
=3D=3D8828=3D=3D LEAK SUMMARY:
=3D=3D8828=3D=3D definitely lost: 584 bytes in 22 blocks.
=3D=3D8828=3D=3D possibly lost: 0 bytes in 0 blocks.
=3D=3D8828=3D=3D still reachable: 37 bytes in 3 blocks.
=3D=3D8828=3D=3D suppressed: 0 bytes in 0 blocks.
=3D=3D8828=3D=3D Rerun with --leak-check=3Dfull to see details of leaked mem=
ory.

I then ran with options --leak-check=3Dfull --show-reachable=3Dyes:

=3D=3D21927=3D=3D ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 14 fr=
om 2)
=3D=3D21927=3D=3D malloc/free: in use at exit: 621 bytes in 25 blocks.
=3D=3D21927=3D=3D malloc/free: 96 allocs, 71 frees, 21,932 bytes allocated.
=3D=3D21927=3D=3D For counts of detected errors, rerun with: -v
=3D=3D21927=3D=3D Use --track-origins=3Dyes to see where uninitialised value=
s come from
=3D=3D21927=3D=3D searching for pointers to 25 not-freed blocks.
=3D=3D21927=3D=3D checked 122,080 bytes.
=3D=3D21927=3D=3D
=3D=3D21927=3D=3D
=3D=3D21927=3D=3D 37 bytes in 3 blocks are still reachable in loss record 1 =
of 4
=3D=3D21927=3D=3D at 0x4C24C1E: malloc (in =20
/usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
=3D=3D21927=3D=3D by 0x54F5D31: strdup (in /lib64/libc-2.9.so)
=3D=3D21927=3D=3D by 0x402B6C: read_config_file (in /usr/bin/nsca)
=3D=3D21927=3D=3D by 0x4037DD: main (in /usr/bin/nsca)
=3D=3D21927=3D=3D
=3D=3D21927=3D=3D
=3D=3D21927=3D=3D 584 (104 direct, 480 indirect) bytes in 2 blocks are =20
definitely lost in loss record 2 of 4
=3D=3D21927=3D=3D at 0x4C24C1E: malloc (in =20
/usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
=3D=3D21927=3D=3D by 0x555A4AA: (within /lib64/libc-2.9.so)
=3D=3D21927=3D=3D by 0x555AC26: __nss_database_lookup (in /lib64/libc-2.9=
.so)
=3D=3D21927=3D=3D by 0x5BD233F: ???
=3D=3D21927=3D=3D by 0x5BD33D6: ???
=3

...[email truncated]...


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