Bug 761924 (GLUSTER-192)

Summary: sefault in posix-readdir
Product: [Community] GlusterFS Reporter: Amar Tumballi <amarts>
Component: posixAssignee: Anand Avati <aavati>
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: low    
Version: 2.0.5CC: chrisw, gluster-bugs, gowda, lakshmipathi, vijay, vraman
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Solaris   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: RTNR Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Anand Avati 2009-08-04 20:38:24 UTC
(gdb) fr 7
#7  0xfec9b9c3 in posix_readdir (frame=0x8ce2998, this=0x80b0b48, fd=0x8e2c988, size=4096, off=293844269) at posix.c:3524



(gdb) p/o fd->inode->st_mode
$4 = 0100664

That is the mode of a file

(gdb) p *pfd
$5 = {fd = 19, flags = 1, path = 0x0, dir = 0x0}

The pfd structure shows that it is a filedescriptor of a file (dir and path are NULL)

fr 7 shows that a readdir has happened on a file

Comment 1 Anand Avati 2009-08-04 21:07:14 UTC
PATCH: http://patches.gluster.com/patch/862 in master (add check for making sure 'fd' belongs to directory in posix-readdir)

Comment 2 Anand Avati 2009-08-04 21:07:21 UTC
PATCH: http://patches.gluster.com/patch/861 in release-2.0 (add check for making sure 'fd' belongs to directory in posix-readdir)

Comment 3 Amar Tumballi 2009-08-04 23:33:24 UTC
below is the backtrace

Program terminated with signal 11, Segmentation fault.
#0  0xfedaa0b7 in _lwp_kill () from /lib/libc.so.1
(gdb) bt
#0  0xfedaa0b7 in _lwp_kill () from /lib/libc.so.1
#1  0xfeda5814 in thr_kill () from /lib/libc.so.1
#2  0xfed51df3 in raise () from /lib/libc.so.1
#3  0xfee631f2 in gf_print_trace (signum=11) at common-utils.c:424
#4  0xfeda742f in __sighndlr () from /lib/libc.so.1
#5  0xfed9d141 in call_user_handler () from /lib/libc.so.1
#6  <signal handler called>
#7  0xfec9b9c3 in posix_readdir (frame=0x8ce2998, this=0x80b0b48, fd=0x8e2c988, size=4096, off=293844269) at posix.c:3524
#8  0xfee6233c in default_readdir (frame=0x89976d8, this=0x80b1828, fd=0x8e2c988, size=4096, off=293844269) at defaults.c:1400
#9  0xfec55220 in iot_readdir_wrapper (frame=0x857e918, this=0x80b18c0, fd=0x8e2c988, size=4096, offset=293844269)
    at io-threads.c:1689
#10 0xfee6d6c7 in call_resume (stub=0x8686e00) at call-stub.c:2661
#11 0xfec555d5 in iot_worker_ordered (arg=0x80b1e60) at io-threads.c:1943
#12 0xfeda7045 in _thr_setup () from /lib/libc.so.1
#13 0xfeda7330 in L3_doit () from /lib/libc.so.1
#14 0xfecc1200 in ?? ()
#15 0x00000000 in ?? ()
----
It looks like the segfault happened due to readdir call on a file's 'fd'.

Comment 4 Basavanagowda Kanur 2009-08-05 03:23:42 UTC
this is a duplicate of the bug-173.

can you mention the process you followed to produce this crash?

Comment 5 Anand Avati 2009-08-07 05:24:08 UTC
PATCH: http://patches.gluster.com/patch/943 in master (protocol/client: fixed registration of saved_fds)

Comment 6 Anand Avati 2009-08-07 05:24:25 UTC
PATCH: http://patches.gluster.com/patch/943 in release-2.0 (protocol/client: fixed registration of saved_fds)

Comment 7 Vijay Bellur 2009-08-14 07:08:28 UTC

*** This bug has been marked as a duplicate of bug 126 ***