Bug 761960 (GLUSTER-228) - Segmentation fault in glusterfs_getxattr
Summary: Segmentation fault in glusterfs_getxattr
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-228
Product: GlusterFS
Classification: Community
Component: libglusterfsclient
Version: 2.0.6
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Raghavendra G
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-08-26 09:23 UTC by Raghavendra G
Modified: 2009-09-03 04:02 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

Description Raghavendra G 2009-08-26 07:42:30 UTC
A patch has been submitted for review at
http://patches.gluster.com/patch/1170/

Comment 1 Raghavendra G 2009-08-26 09:23:45 UTC
Reported in gluster-devel mailing list.

When I call glusterfs_getxattr, I received 'Segmentation fault' error like the following:

-------------------------------------------

Program received signal SIGSEGV, Segmentation fault.

[Switching to Thread -1209996640 (LWP 16114)]

0xb7ebc046 in free () from /lib/tls/libc.so.6

(gdb) bt

#0  0xb7ebc046 in free () from /lib/tls/libc.so.6

#1  0xb7f9c611 in __glusterfs_glh_getxattr (handle=0xb7f854c0,

    path=0x808fc80 "/r/rest_test_nodelete/hello_70301.txt",

    name=0x8090206 "hello_70301.txt", value=0x804a008, size=1024, whichop=1)

    at libglusterfsclient.c:2273

#2  0xb7f9c944 in glusterfs_getxattr (

    path=0x8048af8 "/home/minjae/gluster_test/libglusterfs/mount/r/rest_test_nodelete/hello_70301.txt", name=0x8048bbd "user.test", value=0x804a008, size=1024)

    at libglusterfsclient.c:2327

#3  0x0804886d in main () at test.c:54

-------------------------------------------

The attribute name was "user.test" in #3, but this was changed to "hello_70301.txt" in #2.

About some files, glusterfs_getxattr is working well, but sometimes working strange including this.


The bug is in __glusterfs_glh_getxattr, where a pointer pointing to basename is freed, instead of pointer pointing to the entire path.

Comment 2 mjshin 2009-08-27 01:17:55 UTC
The patch is working well.
Thank you.

Comment 3 Anand Avati 2009-09-02 14:29:59 UTC
PATCH: http://patches.gluster.com/patch/1170 in master (libglusterfsclient: don't use pointer returned by basename while freeing allocated memory.)

Comment 4 Anand Avati 2009-09-02 14:30:21 UTC
PATCH: http://patches.gluster.com/patch/1169 in release-2.0 (libglusterfsclient: don't use pointer returned from basename to free allocated memory.)


Note You need to log in before you can comment on or make changes to this bug.