Bug 1222898 - geo-replication: fix memory leak in gsyncd
Summary: geo-replication: fix memory leak in gsyncd
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: geo-replication
Version: mainline
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
Assignee: Prasanna Kumar Kalever
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-19 12:09 UTC by Prasanna Kumar Kalever
Modified: 2016-06-16 13:03 UTC (History)
4 users (show)

Fixed In Version: glusterfs-3.8rc2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-16 13:03:00 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Prasanna Kumar Kalever 2015-05-19 12:09:39 UTC
Description of problem:
 1. leak in str2argv() function pointed to str
 2. leak in main() function pointed to argv

Version-Release number of selected component (if applicable):
mainline

How reproducible:
run any leak detection tools on gsyncd

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Anand Avati 2015-05-19 12:10:13 UTC
REVIEW: http://review.gluster.org/10831 (geo-replication: fix memory leak in gsyncd) posted (#1) for review on master by Prasanna Kumar Kalever

Comment 2 Anand Avati 2015-07-14 13:12:12 UTC
COMMIT: http://review.gluster.org/10831 committed in master by Venky Shankar (vshankar) 
------
commit 2ca64411fd134eb03fc8b40dec91e94027ad82b1
Author: Prasanna Kumar Kalever <prasanna.kalever>
Date:   Tue May 19 17:24:45 2015 +0530

    geo-replication: fix memory leak in gsyncd
    
    1. leak in str2argv() function:
    
    char *strdup(const char *s);
    The strdup() function returns a pointer to a new string which is a
    duplicate of the  string  s. Memory for the new string is obtained
    with malloc(3), and can be freed with free(3).
    
    so when using strdup, user has to take care of freeing the memory
    allocated by strdup library function.
    
    2. leak in main() function:
    
    str2argv() function calls calloc and allocates memory pointed to argv,
    after return from str2argv() memory pointed to argv has to be cleaned
    in main().
    
    This patch is to fix 2 memory leaks mentioned above.
    
    Change-Id: I6bf26101e0460a7324ac7bdb69905839688d4987
    BUG: 1222898
    Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever>
    Reviewed-on: http://review.gluster.org/10831
    Tested-by: NetBSD Build System <jenkins.org>
    Reviewed-by: Milind Changire <mchangir>
    Reviewed-by: Kotresh HR <khiremat>
    Reviewed-by: Venky Shankar <vshankar>

Comment 3 Anand Avati 2015-07-23 13:38:32 UTC
REVIEW: http://review.gluster.org/11751 (geo-rep: Fix gsyncd failing to start on slave) posted (#1) for review on master by Kotresh HR (khiremat)

Comment 4 Anand Avati 2015-08-03 08:48:09 UTC
REVIEW: http://review.gluster.org/11751 (geo-rep: Fix gsyncd failing to start on slave) posted (#3) for review on master by Kotresh HR (khiremat)

Comment 5 Vijay Bellur 2016-05-02 13:40:37 UTC
REVIEW: http://review.gluster.org/14151 (geo-rep: address potential leak of memory) posted (#1) for review on master by Prasanna Kumar Kalever (pkalever)

Comment 6 Vijay Bellur 2016-05-02 13:53:47 UTC
REVIEW: http://review.gluster.org/14151 (geo-rep: address potential leak of memory) posted (#2) for review on master by Prasanna Kumar Kalever (pkalever)

Comment 7 Niels de Vos 2016-06-16 13:03:00 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.8.0, please open a new bug report.

glusterfs-3.8.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://blog.gluster.org/2016/06/glusterfs-3-8-released/
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user


Note You need to log in before you can comment on or make changes to this bug.