[ZBX-10486] Memory leaks in libcurl / libnss on RHEL 6, 7 Created: 2016 Mar 02  Updated: 2018 Nov 15  Resolved: 2016 Jun 06

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.2.12rc1
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: Sandis Neilands (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: curl, memoryleak, tls
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CENTOS 6, CENTOS 7, RHEL 6, RHEL 7


Attachments: Zip Archive leak.zip    
Issue Links:
Duplicate
is duplicated by ZBX-12608 http pollers exhaust all memory avail... Closed

 Description   

Quote from https://github.com/curl/curl/issues/696 . See also https://bugzilla.redhat.com/show_bug.cgi?id=1057388 .

Several of our customers reported memory leaks when using Zabbix with web-scenarios. We tracked down the problem to libcurl / libnss and CURLOPT_SSL_VERIFYPEER = 1 option on CENTOS 6, CENTOS 7 and the corresponding RHEL versions. Eventually OOM killer kicks in and kills Zabbix processes.

The attached program demonstrates the issue (see the included README for running instructions). If you run it on the aforementioned operating systems with the default libcurl from their repositories then heap memory segment will grow continuously (run it for several minutes and use the included topmap.sh script to monitor memory segments).

Valgrind doesn't show any lost memory.

Workarounds (in Zabbix code):

  • calling curl_global_init() / curl_global_cleanup() for each retrieved page - unfortunately on Debian based distributions this triggers a memory leak in GnuTLS (see https://bugs.launchpad.net/linuxmint/+bug/1552284);
  • using curl binary instead of the library as it was done for web.page.get[] items in the past.

Operational workarounds:

  • compiling libcurl from sources and using OpenSSL as the TLS backend;
  • disabling "SSL verify peer" option in the web scenarios.


 Comments   
Comment by Sandis Neilands (Inactive) [ 2016 Mar 02 ]

Attached test program demonstrating the issues.

Comment by Martins Valkovskis [ 2016 Jun 06 ]

Documented in 'known issues':

sandis.neilands CLOSED, thanks!

Comment by Damien Gombault [ 2018 Nov 15 ]

This problem on RHEL/CentOS 7 should be fixed with curl-7.29.0-51.el7 package.

Related bug reported : https://bugzilla.redhat.com/show_bug.cgi?id=1510247

Related errata : https://access.redhat.com/errata/RHSA-2018:3157

 

Generated at Wed Apr 24 05:10:44 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.