[ZBX-10405] Updating log item metadata causes memory leak in history cache Created: 2016 Feb 18  Updated: 2017 May 30  Resolved: 2016 Feb 18

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 3.0.0
Fix Version/s: 3.0.1rc1, 3.2.0alpha1

Type: Incident report Priority: Blocker
Reporter: Andris Zeila Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: memoryleak
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File cache_usage.png    
Issue Links:
Duplicate
is duplicated by ZBX-10440 Zabbix-server stops working Closed

 Description   

When updating log item metadata (lastlogsize, mtime) a meta value is added to history cache with flag ZBX_DC_FLAG_NOVALUE set. When adding values to history cache this flag is not checked and a value is always cloned into shared memory. However when removing values history cache does check for ZBX_DC_FLAG_NOVALUE flag and does not free value contents if this flag is set.

This causes memory leak for log type items - zbx_log_value_t structure is allocated when meta value is added to cache and not freed when the value is removed.

Symptoms: Zabbix server/proxy keep running but doesn't do data gathering.

Cache usage graph:



 Comments   
Comment by Andris Zeila [ 2016 Feb 18 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-10405

Comment by Alexander Vladishev [ 2016 Feb 18 ]

Successfully tested. Take a look at my changes in r58549.

wiper reviewed, thanks!

Comment by Andris Zeila [ 2016 Feb 18 ]

Released in:

  • pre-3.0.1rc1 r58552
  • pre-3.1.0 r58553
Generated at Sat Apr 26 10:38:13 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.