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