Hi,
is it possible that there is a memory-leak in cf-execd in Version 3.9.0 (community-edition, cfengine-community-3.9.0-1.el6.x86_64.rpm ) on RHEL 6?
We see that the daemon is consuming memory over time - this is new since the update to 3.9.0 .
I´m not very familiar with the correct usage of valgrind, but output after 20 min is:
==00:00:19:37.443 30464== HEAP SUMMARY:
==00:00:19:37.443 30464== in use at exit: 668,148 bytes in 29,147 blocks
==00:00:19:37.443 30464== total heap usage: 892,784 allocs, 863,637 frees, 177,665,575 bytes allocated
==00:00:19:37.443 30464==
==00:00:19:37.499 30464== 2,310 (32 direct, 2,278 indirect) bytes in 1 blocks are definitely lost in loss record 321 of 385
==00:00:19:37.499 30464== at 0x4A057BB: calloc (vg_replace_malloc.c:593)
==00:00:19:37.499 30464== by 0x4C9E4F8: xcalloc (alloc.c:47)
==00:00:19:37.499 30464== by 0x4CA2CA7: JsonElementCreateContainer.clone.0 (json.c:112)
==00:00:19:37.499 30464== by 0x4CBC0E6: GetProcFileInfo (unix_iface.c:1060)
==00:00:19:37.499 30464== by 0x4CBC7ED: GetNetworkingInfo (unix_iface.c:1256)
==00:00:19:37.499 30464== by 0x4CBB3D8: DetectEnvironment (sysinfo.c:2895)
==00:00:19:37.499 30464== by 0x4C7D913: GenericAgentDiscoverContext (generic_agent.c:431)
==00:00:19:37.499 30464== by 0x40439D: main (in /var/cfengine/bin/cf-execd)
==00:00:19:37.499 30464==
==00:00:19:37.499 30464== 10,792 (32 direct, 10,760 indirect) bytes in 1 blocks are definitely lost in loss record 370 of 385
==00:00:19:37.499 30464== at 0x4A057BB: calloc (vg_replace_malloc.c:593)
==00:00:19:37.499 30464== by 0x4C9E4F8: xcalloc (alloc.c:47)
==00:00:19:37.499 30464== by 0x4CA2CA7: JsonElementCreateContainer.clone.0 (json.c:112)
==00:00:19:37.499 30464== by 0x4CBC2EF: GetNetworkingInfo (unix_iface.c:1135)
==00:00:19:37.499 30464== by 0x4CBB3D8: DetectEnvironment (sysinfo.c:2895)
==00:00:19:37.499 30464== by 0x4C7D913: GenericAgentDiscoverContext (generic_agent.c:431)
==00:00:19:37.499 30464== by 0x40439D: main (in /var/cfengine/bin/cf-execd)
==00:00:19:37.499 30464==
==00:00:19:37.499 30464== 16,047 (32 direct, 16,015 indirect) bytes in 1 blocks are definitely lost in loss record 372 of 385
==00:00:19:37.499 30464== at 0x4A057BB: calloc (vg_replace_malloc.c:593)
==00:00:19:37.499 30464== by 0x4C9E4F8: xcalloc (alloc.c:47)
==00:00:19:37.499 30464== by 0x4CA2CA7: JsonElementCreateContainer.clone.0 (json.c:112)
==00:00:19:37.499 30464== by 0x4CBC59B: GetNetworkingInfo (unix_iface.c:1191)
==00:00:19:37.499 30464== by 0x4CBB3D8: DetectEnvironment (sysinfo.c:2895)
==00:00:19:37.499 30464== by 0x4C7D913: GenericAgentDiscoverContext (generic_agent.c:431)
==00:00:19:37.499 30464== by 0x40439D: main (in /var/cfengine/bin/cf-execd)
==00:00:19:37.499 30464==
==00:00:19:37.499 30464== 43,890 (608 direct, 43,282 indirect) bytes in 19 blocks are definitely lost in loss record 380 of 385
==00:00:19:37.499 30464== at 0x4A057BB: calloc (vg_replace_malloc.c:593)
==00:00:19:37.499 30464== by 0x4C9E4F8: xcalloc (alloc.c:47)
==00:00:19:37.499 30464== by 0x4CA2CA7: JsonElementCreateContainer.clone.0 (json.c:112)
==00:00:19:37.499 30464== by 0x4CBC0E6: GetProcFileInfo (unix_iface.c:1060)
==00:00:19:37.499 30464== by 0x4CBC7ED: GetNetworkingInfo (unix_iface.c:1256)
==00:00:19:37.499 30464== by 0x4CBB3D8: DetectEnvironment (sysinfo.c:2895)
==00:00:19:37.499 30464== by 0x404037: StartServer (in /var/cfengine/bin/cf-execd)
==00:00:19:37.499 30464== by 0x404410: main (in /var/cfengine/bin/cf-execd)
==00:00:19:37.499 30464==
==00:00:19:37.499 30464== 205,048 (608 direct, 204,440 indirect) bytes in 19 blocks are definitely lost in loss record 384 of 385
==00:00:19:37.499 30464== at 0x4A057BB: calloc (vg_replace_malloc.c:593)
==00:00:19:37.499 30464== by 0x4C9E4F8: xcalloc (alloc.c:47)
==00:00:19:37.499 30464== by 0x4CA2CA7: JsonElementCreateContainer.clone.0 (json.c:112)
==00:00:19:37.499 30464== by 0x4CBC2EF: GetNetworkingInfo (unix_iface.c:1135)
==00:00:19:37.499 30464== by 0x4CBB3D8: DetectEnvironment (sysinfo.c:2895)
==00:00:19:37.499 30464== by 0x404037: StartServer (in /var/cfengine/bin/cf-execd)
==00:00:19:37.499 30464== by 0x404410: main (in /var/cfengine/bin/cf-execd)
==00:00:19:37.499 30464==
==00:00:19:37.499 30464== 304,893 (608 direct, 304,285 indirect) bytes in 19 blocks are definitely lost in loss record 385 of 385
==00:00:19:37.499 30464== at 0x4A057BB: calloc (vg_replace_malloc.c:593)
==00:00:19:37.499 30464== by 0x4C9E4F8: xcalloc (alloc.c:47)
==00:00:19:37.499 30464== by 0x4CA2CA7: JsonElementCreateContainer.clone.0 (json.c:112)
==00:00:19:37.499 30464== by 0x4CBC59B: GetNetworkingInfo (unix_iface.c:1191)
==00:00:19:37.499 30464== by 0x4CBB3D8: DetectEnvironment (sysinfo.c:2895)
==00:00:19:37.499 30464== by 0x404037: StartServer (in /var/cfengine/bin/cf-execd)
==00:00:19:37.499 30464== by 0x404410: main (in /var/cfengine/bin/cf-execd)
==00:00:19:37.499 30464==
==00:00:19:37.499 30464== LEAK SUMMARY:
==00:00:19:37.499 30464== definitely lost: 1,920 bytes in 60 blocks
==00:00:19:37.499 30464== indirectly lost: 581,060 bytes in 29,040 blocks
==00:00:19:37.499 30464== possibly lost: 0 bytes in 0 blocks
==00:00:19:37.499 30464== still reachable: 85,168 bytes in 47 blocks
==00:00:19:37.499 30464== suppressed: 0 bytes in 0 blocks
==00:00:19:37.499 30464== Reachable blocks (those to which a pointer was found) are not shown.
==00:00:19:37.499 30464== To see them, rerun with: --leak-check=full --show-reachable=yes
==00:00:19:37.499 30464==
==00:00:19:37.499 30464== For counts of detected and suppressed errors, rerun with: -v
==00:00:19:37.499 30464== Use --track-origins=yes to see where uninitialised values come from
==00:00:19:37.499 30464== ERROR SUMMARY: 32558 errors from 141 contexts (suppressed: 6 from 6)
valgrind was called with
# valgrind --time-stamp=yes --log-file=/var/tmp/valgrind-cfexec.%p --leak-check=full /var/cfengine/bin/cf-execd -F
Any help is welcome.
Best regards
Sven