Bug 765463 (GLUSTER-3731)

Summary: Crash on exit after an error
Product: [Community] GlusterFS Reporter: Pete Zaitcev <zaitcev>
Component: cliAssignee: Amar Tumballi <amarts>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: pre-releaseCC: gluster-bugs, vraman
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Pete Zaitcev 2011-10-17 22:02:37 UTC
http://review.gluster.com/606

Comment 1 Pete Zaitcev 2011-10-18 00:49:34 UTC
On a Fedora system, if glusterfs-fuse is not installed [sic]:

glusterfs -f /var/lib/hekafs/symvol.vol /mnt/symvol

[101580.407507] glusterfs[2532]: segfault at 0 ip 00007f8597c9ebc1 sp 00007fff7de34b40 error 4 in libglusterfs.so.0.0.0[7f8597c83000+5e000]

Core was generated by `glusterfs -f /var/lib/hekafs/symvol.vol /mnt/symvol'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f8597c9ebc1 in xlator_destroy (xl=0x1e130b0) at xlator.c:1793
1793            list_for_each_entry_safe (vol_opt, tmp, &xl->volume_options, list) {
Missing separate debuginfos, use: debuginfo-install glusterfs-3.2.4-1.fc17.x86_64
(gdb) where
#0  0x00007f8597c9ebc1 in xlator_destroy (xl=0x1e130b0) at xlator.c:1793
#1  0x0000000000404bf7 in create_fuse_mount ()
#2  0x0000000000403878 in main ()

Comment 2 Amar Tumballi 2011-10-25 02:22:53 UTC
Hi Pete,

I could see that to fix the issue, below patch is enough. Let me know what you think.

amar@supernova:~/work/glusterfs$ git diff
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index 0d8c258..92d78da 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -190,9 +190,10 @@ xlator_dynload (xlator_t *xl)
         void              *handle = NULL;
         volume_opt_list_t *vol_opt = NULL;
 
-
         GF_VALIDATE_OR_GOTO ("xlator", xl, out);
 
+        INIT_LIST_HEAD (&xl->volume_options);
+
         ret = gf_asprintf (&name, "%s/%s.so", XLATORDIR, xl->type);
         if (-1 == ret) {
                 gf_log ("xlator", GF_LOG_ERROR, "asprintf failed");
@@ -256,8 +257,6 @@ xlator_dynload (xlator_t *xl)
                         dlerror());
         }
 
-        INIT_LIST_HEAD (&xl->volume_options);
-
         vol_opt = GF_CALLOC (1, sizeof (volume_opt_list_t),
                          gf_common_mt_volume_opt_list_t);
 
amar@supernova:~/work/glusterfs$

I will be marking your patch as -1, let me know if I should submit it, or you can submit this too.

Comment 3 Anand Avati 2011-11-17 02:11:00 UTC
CHANGE: http://review.gluster.com/606 (was happening when any of the dlopen() fails for xlator loading, and) merged in master by Vijay Bellur (vijay)

Comment 4 Amar Tumballi 2011-11-17 07:54:17 UTC
fixed in master