https://bugzilla.redhat.com/show_bug.cgi?id=1331973
Bug ID: 1331973
Summary: memory leak in erroneous derived-metrics
Product: Fedora
Version: rawhide
Component: pcp
Assignee: nathans@xxxxxxxxxx
Reporter: fche@xxxxxxxxxx
QA Contact: extras-qa@xxxxxxxxxxxxxxxxx
CC: brolley@xxxxxxxxxx, fche@xxxxxxxxxx, lberk@xxxxxxxxxx,
mgoodwin@xxxxxxxxxx, nathans@xxxxxxxxxx,
pcp@xxxxxxxxxxx, scox@xxxxxxxxxx
In pcp 3.11.2, derived metrics are automatically added as a part of context
initialization. However, if there is an error, the derive.c code does not
clean up fully.
% mkdir foo
% echo 'foo.bar = 100 * delta(non.existent)' > foo/derived.conf
% PCP_DERIVED_CONFIG=`pwd`/foo valgrind --leak-check=full pminfo -f foo.bar
==20471== 144 (64 direct, 80 indirect) bytes in 1 blocks are definitely lost in
loss record 35 of 40
==20471== at 0x4C28C50: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==20471== by 0x4E7F751: newnode (derive.c:532)
==20471== by 0x4E80D13: bind_expr (derive.c:569)
==20471== by 0x4E80D27: bind_expr (derive.c:571)
==20471== by 0x4E8329A: __dmopencontext (derive.c:2130)
==20471== by 0x4E4A612: pmNewContext (context.c:1151)
==20471== by 0x4017AD: main (pminfo.c:646)
derive.c bind_expr() is clearly implicated. If the left or right bind_expr()
subcalls fail, the new newnode() is never freed. But one should audit all
the related code to guarantee a proper cleanup on an error.
--
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug
https://bugzilla.redhat.com/token.cgi?t=it0yP2BBA4&a=cc_unsubscribe
|