[Bug 280] New: Memory leak in value-pairs.c
https://bugzilla.balabit.com/show_bug.cgi?id=280 Summary: Memory leak in value-pairs.c Product: syslog-ng Version: 3.5.x Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: unspecified Component: syslog-ng AssignedTo: bazsi@balabit.hu ReportedBy: sgounaro@optonline.net Type of the Report: bug Estimated Hours: 0.0 Hi , it looks like vp_walker_name_value_split_add_name_token has a memory leak in g_strndup call. Running syslog-ng with a lot of messages coming in about ~800 per sec , starts with 139m of memory and ends up with 9gig of memory in a day being used. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=280 SpiroG <sgounaro@optonline.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sgounaro@optonline.net -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=280 --- Comment #1 from Balazs Scheidler <bazsi@balabit.hu> 2014-05-18 22:46:02 --- Hi, can you check if this patch fixes it for you? diff --git a/lib/value-pairs.c b/lib/value-pairs.c index 2256758..d10587a 100644 --- a/lib/value-pairs.c +++ b/lib/value-pairs.c @@ -618,7 +618,10 @@ vp_walker_name_value_split(const gchar *name) vp_walker_name_value_split_add_name_token(array, name, ¤t_name_start_idx, &i); if (array->len == 0) - return NULL; + { + g_ptr_array_free(array); + return NULL; + } return array; } There was a proposed patch on github to fix this issue: https://github.com/balabit/syslog-ng/pull/126 That fix is not correct though, this one definitely fixes a leak, I'm just not sure if this is the one that affects you. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=280 --- Comment #2 from SpiroG <sgounaro@optonline.net> 2014-05-21 00:17:40 --- Hi ,this does not solve it, it makes a little better but it still memory leaks... I have added this: g_ptr_array_foreach(tokens, (GFunc)g_free, NULL); at line 657 in value-pairs.c to clear the items that the array points to before we free the array. That solves the issue. Thanks (In reply to comment #1)
Hi,
can you check if this patch fixes it for you?
diff --git a/lib/value-pairs.c b/lib/value-pairs.c index 2256758..d10587a 100644 --- a/lib/value-pairs.c +++ b/lib/value-pairs.c @@ -618,7 +618,10 @@ vp_walker_name_value_split(const gchar *name) vp_walker_name_value_split_add_name_token(array, name, ¤t_
return array; }
There was a proposed patch on github to fix this issue:
https://github.com/balabit/syslog-ng/pull/126
That fix is not correct though, this one definitely fixes a leak, I'm just not sure if this is the one that affects you.
-- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=280 --- Comment #3 from Balazs Scheidler <bazsi@balabit.hu> 2014-05-21 00:21:38 --- That was already fixed in 3.6 -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=280 Gergely Nagy <algernon@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |algernon@balabit.hu Resolution| |FIXED Status|NEW |RESOLVED --- Comment #4 from Gergely Nagy <algernon@balabit.hu> 2014-07-08 13:02:19 --- This is fixed on both master and 3.5/master. Thanks for the report! -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
bugzilla@bugzilla.balabit.com