Bug 762195 (GLUSTER-463)

Summary: Crash in dht_stat_merge ()
Product: [Community] GlusterFS Reporter: Vijay Bellur <vijay>
Component: distributeAssignee: Anand Avati <aavati>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: low    
Version: 3.0.0CC: chrisw, gluster-bugs
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 Vijay Bellur 2009-12-12 13:42:10 UTC
mkdir() failed because of ENOMEM and the following crash was observed in dht:

(gdb) bt
#0  0x00002aaaac3ac398 in dht_stat_merge (this=0x612b80, to=0x2aaab4e62bd8, from=0x0, subvol=0x612040)
    at ../../../../../xlators/cluster/dht/src/dht-helper.c:323
#1  0x00002aaaac3ae222 in dht_selfheal_dir_mkdir_cbk (frame=0x2aaab419ff70, cookie=0x2aaab42bf280, this=0x612b80, op_ret=-1, op_errno=12, inode=0x0, 
    stbuf=0x0, preparent=0x0, postparent=0x0) at ../../../../../xlators/cluster/dht/src/dht-selfheal.c:215
#2  0x00002aaaac169e1a in afr_mkdir (frame=0x2aaab42bf280, this=0x612040, loc=0x2aaab4e62b78, mode=16877)
    at ../../../../../xlators/cluster/afr/src/afr-dir-write.c:852
#3  0x00002aaaac3ae661 in dht_selfheal_dir_mkdir (frame=0x2aaab419ff70, loc=0x2aaab4e62b78, layout=0x61b9d0, force=1)
    at ../../../../../xlators/cluster/dht/src/dht-selfheal.c:271
#4  0x00002aaaac3af0a9 in dht_selfheal_restore (frame=0x2aaab419ff70, dir_cbk=0x2aaaac3c54a5 <dht_rmdir_selfheal_cbk>, loc=0x2aaab4e62b78, layout=0x61b9d0)
    at ../../../../../xlators/cluster/dht/src/dht-selfheal.c:531
#5  0x00002aaaac3c57e7 in dht_rmdir_cbk (frame=0x2aaab419ff70, cookie=0x2aaab4b326b0, this=0x612b80, op_ret=-1, op_errno=12, preparent=0x0, postparent=0x0)
    at ../../../../../xlators/cluster/dht/src/dht-common.c:3202
#6  0x00002aaaac16de05 in afr_rmdir (frame=0x2aaab4b326b0, this=0x612920, loc=0x2aaab4e62b78) at ../../../../../xlators/cluster/afr/src/afr-dir-write.c:2001
#7  0x00002aaaac3c5b42 in dht_rmdir_do (frame=0x2aaab419ff70, this=0x612b80) at ../../../../../xlators/cluster/dht/src/dht-common.c:3238
#8  0x00002aaaac3c5fe7 in dht_rmdir_opendir_cbk (frame=0x2aaab419ff70, cookie=0x2aaab4cc29b0, this=0x612b80, op_ret=-1, op_errno=12, fd=0x2aaab46a4af0)
    at ../../../../../xlators/cluster/dht/src/dht-common.c:3312
#9  0x00002aaaac16509c in afr_opendir (frame=0x2aaab4cc29b0, this=0x612920, loc=0x2aaab48cd548, fd=0x2aaab46a4af0)
    at ../../../../../xlators/cluster/afr/src/afr-dir-read.c:319
#10 0x00002aaaac3c65cc in dht_rmdir (frame=0x2aaab419ff70, this=0x612b80, loc=0x2aaab48cd548) at ../../../../../xlators/cluster/dht/src/dht-common.c:3365
#11 0x00002aaaaace430e in default_rmdir (frame=0x2aaab441d380, this=0x613460, loc=0x2aaab48cd548) at ../../../libglusterfs/src/defaults.c:353
#12 0x00002aaaaace430e in default_rmdir (frame=0x2aaab4b3cb10, this=0x613db0, loc=0x2aaab48cd548) at ../../../libglusterfs/src/defaults.c:353
#13 0x00002aaaaace430e in default_rmdir (frame=0x2aaab4f14220, this=0x6146e0, loc=0x2aaab48cd548) at ../../../libglusterfs/src/defaults.c:353
#14 0x00002aaaacc020a3 in fuse_rmdir (this=0x60bde0, finh=0x2aaab485bf60, msg=0x2aaab485bf88) at ../../../../../xlators/mount/fuse/src/fuse-bridge.c:1444
#15 0x00002aaaacc0a8ff in fuse_thread_proc (data=0x60bde0) at ../../../../../xlators/mount/fuse/src/fuse-bridge.c:3169
#16 0x00002aaaab152367 in start_thread () from /lib64/libpthread.so.0
#17 0x00002aaaab43af7d in clone () from /lib64/libc.so.6


This needs to be handled more gracefully.

Comment 1 Vijay Bellur 2009-12-16 14:25:36 UTC
PATCH: http://patches.gluster.com/patch/2613 in master (cluster/dht: Check for pointers before de-referencing in dht_stat_merge())