d1681e
From 4fb594e8d54bad70ddd1e195af422bbd0b9fd4a8 Mon Sep 17 00:00:00 2001
d1681e
From: Sanju Rakonde <srakonde@redhat.com>
d1681e
Date: Wed, 4 Jul 2018 14:45:51 +0530
d1681e
Subject: [PATCH 308/325] glusterd: Fix glusterd crash
d1681e
d1681e
Problem: gluster get-state command is crashing glusterd process, when
d1681e
geo-replication session is configured.
d1681e
d1681e
Cause: Crash is happening due to the double free of memory. In
d1681e
glusterd_print_gsync_status_by_vol we are calling dict_unref(), which
d1681e
will free all the keys and values in the dictionary. Before calling
d1681e
dict_unref(), glusterd_print_gsync_status_by_vol is calling
d1681e
glusterd_print_gsync_status(). glusterd_print_gsync_status is freeing
d1681e
up values in the dictionary and again when dict_unref() is called, it
d1681e
tries to free up the values which are already freed.
d1681e
d1681e
Solution: Remove the code which will free the memory in
d1681e
glusterd_print_gsync_status function.
d1681e
d1681e
>Fixes: bz#1598345
d1681e
>Change-Id: Id3d8aae109f377b462bbbdb96a8e3c5f6b0be752
d1681e
>Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
d1681e
d1681e
upstream patch: https://review.gluster.org/#/c/20461/
d1681e
d1681e
Change-Id: Id3d8aae109f377b462bbbdb96a8e3c5f6b0be752
d1681e
BUG: 1578716
d1681e
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
d1681e
Reviewed-on: https://code.engineering.redhat.com/gerrit/143323
d1681e
Tested-by: RHGS Build Bot <nigelb@redhat.com>
d1681e
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
d1681e
---
d1681e
 xlators/mgmt/glusterd/src/glusterd-handler.c | 9 ---------
d1681e
 1 file changed, 9 deletions(-)
d1681e
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
d1681e
index c0c3e25..395b342 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
d1681e
@@ -5155,15 +5155,6 @@ glusterd_print_gsync_status (FILE *fp, dict_t *gsync_dict)
d1681e
                          volcount, i+1, get_struct_variable(15, status_vals[i]));
d1681e
         }
d1681e
 out:
d1681e
-        for (i = 0; i < gsync_count; i++) {
d1681e
-                if (status_vals[i]) {
d1681e
-                        GF_FREE (status_vals[i]);
d1681e
-                }
d1681e
-        }
d1681e
-
d1681e
-        if (status_vals)
d1681e
-                GF_FREE (status_vals);
d1681e
-
d1681e
         return ret;
d1681e
 }
d1681e
 
d1681e
-- 
d1681e
1.8.3.1
d1681e