Bug 763621 (GLUSTER-1889)

Summary: gluster FUSE client crashes on irregularity
Product: [Community] GlusterFS Reporter: Csaba Henk <csaba>
Component: fuseAssignee: Amar Tumballi <amarts>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: mainlineCC: gluster-bugs, vijay, vraman
Target Milestone: ---   
Target Release: ---   
Hardware: All   
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 Csaba Henk 2010-10-09 23:48:56 UTC
Apply the following patch:

--------
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -828,7 +828,7 @@ server_graph_builder (glusterfs_graph_t *graph, glusterd_volinfo_t *volinfo,
         if (ret)
                 return -1;

-        xl = volgen_graph_add_as (graph, "debug/io-stats", path);
+        xl = volgen_graph_add_as (graph, "debug/io-stats", "over-the-rainbow");
         if (!xl)
                 return -1;


--------

Set up glusterd and a volume, and then mount the vol with a client in debug mode:

# glusterfs --debug -s localhost --volfile-id=pop /mnt/gluster0/

Then in another shell try to cd into the fs:

# cd /mnt/gluster0

This gives:

...
[2010-10-10 01:41:14.407861] E [client-handshake.c:492:client_setvolume_cbk] pop-client-0: SETVOLUME on remote-host failed: remote-subvolume "/tmp/ex0" is not found
[2010-10-10 01:41:14.408454] I [fuse-bridge.c:2863:fuse_init] glusterfs-fuse: FUSE inited with protocol versions: glusterfs 7.13 kernel 7.15
pending frames:

patchset: git://git.sv.gnu.org/gluster.git
signal received: 11
time of crash: 2010-10-10 01:41:19
configuration details:
argp 1
backtrace 1
dlfcn 1
fdatasync 1
libpthread 1
llistxattr 1
setfsid 1
spinlock 1
epoll.h 1
xattr.h 1
st_atim.tv_nsec 1
package-string: glusterfs 3.1.0git
/host/lib/libc.so.6(+0x325e0)[0x7f70461ac5e0]
/meta/progs/glusterfs-git/usr/lib/glusterfs/3.1.0git/xlator/mount/fuse.so(fuse_loc_fill+0x212)[0x7f7045280f5c]
/meta/progs/glusterfs-git/usr/lib/glusterfs/3.1.0git/xlator/mount/fuse.so(+0x95b0)[0x7f70452855b0]
/meta/progs/glusterfs-git/usr/lib/glusterfs/3.1.0git/xlator/mount/fuse.so(+0x18beb)[0x7f7045294beb]
/host/lib/libpthread.so.0(+0x6cb0)[0x7f70464dccb0]
/host/lib/libc.so.6(clone+0x6d)[0x7f70462487ad]
---------
Segmentation fault (core dumped)
[root@quartz ~]# gdb glusterfs core
GNU gdb (GDB) 7.2
...
Core was generated by `glusterfs --debug -s localhost --volfile-id=pop /mnt/gluster0/'.
Program terminated with signal 11, Segmentation fault.
#0  fuse_loc_fill (loc=0x1a9afb0, state=0x1a9af98, ino=1, par=0, name=0x0) at fuse-helpers.c:243
243                             gf_log ("glusterfs-fuse", GF_LOG_DEBUG,
(gdb) bt
#0  fuse_loc_fill (loc=0x1a9afb0, state=0x1a9af98, ino=1, par=0, name=0x0) at fuse-helpers.c:243
#1  0x00007f70452855b0 in fuse_getattr (this=0x1a84938, finh=0x1a9ad28, msg=0x1a9ad50) at fuse-bridge.c:463
#2  0x00007f7045294beb in fuse_thread_proc (data=0x1a84938) at fuse-bridge.c:3166
#3  0x00007f70464dccb0 in start_thread () from /host/lib/libpthread.so.0
#4  0x00007f70462487ad in clone () from /host/lib/libc.so.6
#5  0x0000000000000000 in ?? ()
(gdb) l
238                             loc->parent = parent;
239                     }
240
241                     ret = inode_path (inode, NULL, &path);
242                     if (ret <= 0) {
243                             gf_log ("glusterfs-fuse", GF_LOG_DEBUG,
244                                     "inode_path failed for %"PRId64,
245                                     inode->ino);
246                             goto fail;
247                     }
(gdb) p inode
$1 = (inode_t *) 0x0

Comment 1 Vijay Bellur 2010-10-11 07:33:01 UTC
PATCH: http://patches.gluster.com/patch/5417 in master (fuse_loc_fill(): handle a case of NULL dereference)