Description of problem: glusterfs client crashed due to abort while running posix_compliance tests in mdc_symlink_cbk. Did stat-prefetch (which is now md-cache) off while tests are running. This is the backtrace of the core. Core was generated by `/usr/local/sbin/glusterfs --volfile-id=mirror --volfile-server=hyperspace /mnt/'. Program terminated with signal 6, Aborted. #0 0x00007f895d5c0d05 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: Transport endpoint is not connected. in ../nptl/sysdeps/unix/sysv/linux/raise.c (gdb) bt #0 0x00007f895d5c0d05 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #1 0x00007f895d5c4ab6 in abort () at abort.c:92 #2 0x00007f895d5b97c5 in __assert_fail (assertion=0x7f895e1f47bd "0", file=<value optimized out>, line=273, function=<value optimized out>) at assert.c:81 #3 0x00007f895e1c6c35 in __gf_free (free_ptr=0xa3b940) at ../../../libglusterfs/src/mem-pool.c:273 #4 0x00007f89577ab793 in mdc_local_wipe (this=0xa49070, local=0xa5b3b0) at ../../../../../xlators/performance/md-cache/src/md-cache.c:232 #5 0x00007f89577af75d in mdc_symlink_cbk (frame=0x7f895c77b9b4, cookie=0x7f895c77b704, this=0xa49070, op_ret=0, op_errno=0, inode=0x7f89560c8208, buf=0xa59f78, preparent=0xa59ff0, postparent=0xa5a060) at ../../../../../xlators/performance/md-cache/src/md-cache.c:1043 #6 0x00007f895e1976b0 in default_symlink_cbk (frame=0x7f895c77b704, cookie=0x7f895c77b250, this=0xa47d80, op_ret=0, op_errno=0, inode=0x7f89560c8208, buf=0xa59f78, preparent=0xa59ff0, postparent=0xa5a060) at ../../../libglusterfs/src/defaults.c:147 #7 0x00007f895e1976b0 in default_symlink_cbk (frame=0x7f895c77b250, cookie=0x7f895c77b85c, this=0xa46b60, op_ret=0, op_errno=0, inode=0x7f89560c8208, buf=0xa59f78, preparent=0xa59ff0, postparent=0xa5a060) at ../../../libglusterfs/src/defaults.c:147 #8 0x00007f895e1976b0 in default_symlink_cbk (frame=0x7f895c77b85c, cookie=0x7f895c77b04c, this=0xa458d0, op_ret=0, op_errno=0, inode=0x7f89560c8208, buf=0xa59f78, preparent=0xa59ff0, postparent=0xa5a060) at ../../../libglusterfs/src/defaults.c:147 #9 0x00007f895e1976b0 in default_symlink_cbk (frame=0x7f895c77b04c, cookie=0x7f895c77b0f8, this=0xa44620, op_ret=0, op_errno=0, inode=0x7f89560c8208, buf=0xa59f78, preparent=0xa59ff0, postparent=0xa5a060) at ../../../libglusterfs/src/defaults.c:147 #10 0x00007f895821fb91 in afr_symlink_unwind (frame=0x7f895b73484c, this=0xa43390) at ../../../../../xlators/cluster/afr/src/afr-dir-write.c:1026 #11 0x00007f895821ffd1 in afr_symlink_wind_cbk (frame=0x7f895b73484c, cookie=0x0, this=0xa43390, op_ret=0, op_errno=0, inode=0x7f89560c8208, buf=0x7fff1a4087d0, preparent=0x7fff1a408760, postparent=0x7fff1a4086f0) at ../../../../../xlators/cluster/afr/src/afr-dir-write.c:1089 #12 0x00007f89584a5d0d in client3_1_symlink_cbk (req=0x7f89563971c4, iov=0x7f8956397204, count=1, myframe=0x7f895c77b7b0) at ../../../../../xlators/protocol/client/src/client3_1-fops.c:180 #13 0x00007f895df6fb4f in rpc_clnt_handle_reply (clnt=0xa54db0, pollin=0x7f8950000990) at ../../../../rpc/rpc-lib/src/rpc-clnt.c:796 #14 0x00007f895df6fec7 in rpc_clnt_notify (trans=0xa55090, mydata=0xa54de0, event=RPC_TRANSPORT_MSG_RECEIVED, data=0x7f8950000990) at ../../../../rpc/rpc-lib/src/rpc-clnt.c:915 #15 0x00007f895df6bef1 in rpc_transport_notify (this=0xa55090, event=RPC_TRANSPORT_MSG_RECEIVED, data=0x7f8950000990) at ../../../../rpc/rpc-lib/src/rpc-transport.c:498 #16 0x00007f895910a3a5 in socket_event_poll_in (this=0xa55090) at ../../../../../rpc/rpc-transport/socket/src/socket.c:1686 #17 0x00007f895910a919 in socket_event_handler (fd=7, idx=1, data=0xa55090, poll_in=1, poll_out=0, poll_err=0) at ../../../../../rpc/rpc-transport/socket/src/socket.c:1801 #18 0x00007f895e1c5c05 in event_dispatch_epoll_handler (event_pool=0xa31370, events=0xa3ace0, i=1) at ../../../libglusterfs/src/event.c:794 #19 0x00007f895e1c5e1f in event_dispatch_epoll (event_pool=0xa31370) at ../../../libglusterfs/src/event.c:856 #20 0x00007f895e1c6191 in event_dispatch (event_pool=0xa31370) at ../../../libglusterfs/src/event.c:956 #21 0x0000000000407f33 in main (argc=4, argv=0x7fff1a408d38) at ../../../glusterfsd/src/glusterfsd.c:1601 (gdb) f 3 #3 0x00007f895e1c6c35 in __gf_free (free_ptr=0xa3b940) at ../../../libglusterfs/src/mem-pool.c:273 273 GF_ASSERT (0); (gdb) l 268 269 ptr = (char *)free_ptr - 8 - 4; 270 271 if (GF_MEM_HEADER_MAGIC != *(uint32_t *)ptr) { 272 //Possible corruption, assert here 273 GF_ASSERT (0); 274 } 275 276 *(uint32_t *)ptr = 0; 277 (gdb) p ptr $1 = 0xa3b934 "" (gdb) p /x GF_MEM_HEADER_MAGIC $2 = 0xcafebabe (gdb) f 5 #5 0x00007f89577af75d in mdc_symlink_cbk (frame=0x7f895c77b9b4, cookie=0x7f895c77b704, this=0xa49070, op_ret=0, op_errno=0, inode=0x7f89560c8208, buf=0xa59f78, preparent=0xa59ff0, postparent=0xa5a060) at ../../../../../xlators/performance/md-cache/src/md-cache.c:1043 warning: Source file is more recent than executable. 1043 MDC_STACK_UNWIND (symlink, frame, op_ret, op_errno, inode, buf, (gdb) f 4 #4 0x00007f89577ab793 in mdc_local_wipe (this=0xa49070, local=0xa5b3b0) at ../../../../../xlators/performance/md-cache/src/md-cache.c:232 232 GF_FREE (local->linkname); (gdb) l 227 228 if (local->fd) 229 fd_unref (local->fd); 230 231 if (local->linkname) 232 GF_FREE (local->linkname); 233 234 if (local->xattr) 235 dict_unref (local->xattr); 236 (gdb) p local->linkname $3 = 0xa3b940 "fstest_d686a1b113c2aa209baeb1ef10180a3a" (gdb) l mdc_symlink 1047 1048 1049 int 1050 mdc_symlink (call_frame_t *frame, xlator_t *this, const char *linkname, 1051 loc_t *loc, dict_t *params) 1052 { 1053 mdc_local_t *local = NULL; 1054 1055 local = mdc_local_get (frame); 1056 (gdb) 1057 loc_copy (&local->loc, loc); 1058 1059 local->linkname = gf_strdup (linkname); 1060 1061 STACK_WIND (frame, mdc_symlink_cbk, 1062 FIRST_CHILD(this), FIRST_CHILD(this)->fops->symlink, 1063 linkname, loc, params); 1064 return 0; 1065 } 1066 (gdb) In mdc_symlink we are allocating the memory for linkname using strdup, while for freeing it we are using GF_FREE. We should use gf_strdup for allocating in marker _symlink. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1.Run posix compliance test 2.turn stat-prefetch off while tests are running 3. Actual results: glusterfs client crashed. Expected results: glusterfs client should not crash. Additional info: [2012-02-21 15:29:18.036852] I [client-handshake.c:1544:select_server_supported_programs] 0-mirror-client-1: Using Program GlusterFS 3git, Num (1298437), Version (330) [2012-02-21 15:29:18.037119] I [client-handshake.c:1324:client_setvolume_cbk] 0-mirror-client-0: clnt-lk-version = 1, server-lk-version = 0 [2012-02-21 15:29:18.037191] I [client-handshake.c:1350:client_setvolume_cbk] 0-mirror-client-0: Connected to 127.0.0.1:24009, attached to rem ote volume '/mnt/sda7/export3'. [2012-02-21 15:29:18.037431] I [afr-common.c:3461:afr_notify] 0-mirror-replicate-0: Subvolume 'mirror-client-0' came back up; going online. [2012-02-21 15:29:18.037575] I [client-handshake.c:1324:client_setvolume_cbk] 0-mirror-client-1: clnt-lk-version = 1, server-lk-version = 0 [2012-02-21 15:29:18.037617] I [client-handshake.c:1350:client_setvolume_cbk] 0-mirror-client-1: Connected to 127.0.0.1:24010, attached to rem ote volume '/mnt/sda8/export3'. [2012-02-21 15:29:18.053132] I [fuse-bridge.c:4089:fuse_graph_setup] 0-fuse: switched to graph 0 [2012-02-21 15:29:18.054488] I [fuse-bridge.c:3336:fuse_init] 0-glusterfs-fuse: FUSE inited with protocol versions: glusterfs 7.13 kernel 7.16 [2012-02-21 15:29:18.055507] I [afr-common.c:1827:afr_set_root_inode_on_first_lookup] 0-mirror-replicate-0: added root inode pending frames: frame : type(1) op(SYMLINK) frame : type(1) op(SYMLINK) patchset: git://git.gluster.com/glusterfs.git signal received: 6 time of crash: 2012-02-21 15:29:29 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 3git /lib/x86_64-linux-gnu/libc.so.6(+0x33d80)[0x7f895d5c0d80] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35)[0x7f895d5c0d05] /lib/x86_64-linux-gnu/libc.so.6(abort+0x186)[0x7f895d5c4ab6] /lib/x86_64-linux-gnu/libc.so.6(__assert_fail+0xf5)[0x7f895d5b97c5] /usr/local/lib/libglusterfs.so.0(__gf_free+0xa3)[0x7f895e1c6c35] /usr/local/lib/glusterfs/3git/xlator/performance/md-cache.so(mdc_local_wipe+0x7d)[0x7f89577ab793] /usr/local/lib/glusterfs/3git/xlator/performance/md-cache.so(mdc_symlink_cbk+0x23f)[0x7f89577af75d] /usr/local/lib/libglusterfs.so.0(default_symlink_cbk+0x169)[0x7f895e1976b0]
*** This bug has been marked as a duplicate of bug 795682 ***