Bug 181040 - [patch] sysutils/conky "diskio" memory leak fix
Summary: [patch] sysutils/conky "diskio" memory leak fix
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Jason E. Hale
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-05 03:10 UTC by Ken DEGUCHI
Modified: 2014-03-28 09:40 UTC (History)
0 users

See Also:


Attachments
file.txt (1004 bytes, text/plain)
2013-08-05 03:10 UTC, Ken DEGUCHI
no flags Details
conky_diskio_memory_leak_fix_patch.txt (703 bytes, text/plain)
2014-01-31 00:42 UTC, Ken DEGUCHI
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ken DEGUCHI 2013-08-05 03:10:00 UTC
Conky has a memory leak related to "diskio".

When "diskio" variable is enabled, memory consumption is increased by about 8kB every second.

This is caused by "free" the wrong pointer in the function update_diskio in "src/freebsd.c".

This attached patch is modified to free the correct pointer as follows.

free(statinfo_cur.dinfo); -> free(statinfo_cur.dinfo->mem_ptr);

Fix: This attached patch is modified to free the correct pointer as follows.

free(statinfo_cur.dinfo); -> free(statinfo_cur.dinfo->mem_ptr);

Patch attached with submission follows:
How-To-Repeat: When "diskio" variable is enabled, memory consumption is increased by about 8kB every second.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-08-05 03:10:08 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-08-05 03:10:08 UTC
Maintainer of sysutils/conky,

Please note that PR ports/181040 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/181040

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Ken DEGUCHI 2014-01-31 00:42:57 UTC
conky "diskio" memory leak in FreeBSD.
Please commit this patch.
Comment 4 Jason E. Hale freebsd_committer freebsd_triage 2014-03-28 09:20:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->jhale

I'll take it.
Comment 5 dfilter service freebsd_committer freebsd_triage 2014-03-28 09:35:23 UTC
Author: jhale
Date: Fri Mar 28 09:35:19 2014
New Revision: 349402
URL: http://svnweb.freebsd.org/changeset/ports/349402
QAT: https://qat.redports.org/buildarchive/r349402/

Log:
  - Add patch to fix diskio memory leak
  - Bump PORTREVISION
  
  While here:
  - Convert USE_BZIP2 -> USES
  
  PR:		ports/181040
  Submitted by:	Ken DEGUCHI <kdeguchi@sz.tokoha-u.ac.jp>
  Approved by:	maintainer timeout (~8 months)

Modified:
  head/sysutils/conky/Makefile
  head/sysutils/conky/files/patch-src-freebsd.c

Modified: head/sysutils/conky/Makefile
==============================================================================
--- head/sysutils/conky/Makefile	Fri Mar 28 09:23:08 2014	(r349401)
+++ head/sysutils/conky/Makefile	Fri Mar 28 09:35:19 2014	(r349402)
@@ -3,7 +3,7 @@
 
 PORTNAME=	conky
 PORTVERSION=	1.9.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	sysutils
 MASTER_SITES=	SF
 
@@ -13,8 +13,7 @@ COMMENT?=	Advanced, highly configurable 
 CONFLICTS?=	conky-awesome-[0-9]*
 SLAVEDIRS=	sysutils/conky-awesome
 
-USES=		gmake iconv pkgconfig
-USE_BZIP2=	yes
+USES=		gmake iconv pkgconfig tar:bzip2
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS+=	--disable-portmon \
 			--disable-hddtemp \

Modified: head/sysutils/conky/files/patch-src-freebsd.c
==============================================================================
--- head/sysutils/conky/files/patch-src-freebsd.c	Fri Mar 28 09:23:08 2014	(r349401)
+++ head/sysutils/conky/files/patch-src-freebsd.c	Fri Mar 28 09:35:19 2014	(r349402)
@@ -1,5 +1,5 @@
---- src/freebsd.c.orig	2012-05-04 00:08:27.000000000 +0300
-+++ src/freebsd.c	2012-12-04 11:09:20.000000000 +0200
+--- src/freebsd.c.orig	2012-05-04 06:08:27.000000000 +0900
++++ src/freebsd.c	2013-08-05 09:02:37.000000000 +0900
 @@ -38,6 +38,11 @@
  #include <sys/types.h>
  #include <sys/user.h>
@@ -53,3 +53,12 @@
  
  	if (!global_cpu) {
  		malloc_cpu_size = (info.cpu_count + 1) * sizeof(struct cpu_info);
+@@ -702,7 +706,7 @@
+ 		free(dev_select);
+ 	}
+ 
+-	free(statinfo_cur.dinfo);
++	free(statinfo_cur.dinfo->mem_ptr);
+ 	return 0;
+ }
+
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Jason E. Hale freebsd_committer freebsd_triage 2014-03-28 09:36:28 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!