Bug 763095 (GLUSTER-1363)

Summary: crash is pmap_registry_search()
Product: [Community] GlusterFS Reporter: Amar Tumballi <amarts>
Component: glusterdAssignee: Amar Tumballi <amarts>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: low    
Version: mainlineCC: gluster-bugs, 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: fuse
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Amar Tumballi 2010-08-14 01:40:42 EDT
way to reproduce

bash# glusterd
bash# gluster volume create test localhost:/tmp/export/000
bash# gluster volume start test
bash# glusterfs -s localhost --volfile-id test /mnt/glusterfs
bash# df -h &

with these commands 'glusterd' segfaults
Comment 1 Amar Tumballi 2010-08-14 03:00:03 EDT
fixes seems to be minor.. will be sending the patch soon..
Comment 2 Amar Tumballi 2010-08-14 04:37:47 EDT
(gdb) bt
#0  strcmp () at ../sysdeps/x86_64/strcmp.S:29
#1  0x00007f837ec10bf5 in pmap_registry_search (this=0xabe648, brickname=0xac4b40 "/tmp/export/000/")
    at ../../../../../xlators/mgmt/glusterd/src/glusterd-pmap.c:116
#2  0x00007f837ec10e47 in gluster_pmap_portbybrick (req=0xbda0e8)
    at ../../../../../xlators/mgmt/glusterd/src/glusterd-pmap.c:204
#3  0x00007f8380cee1a9 in rpcsvc_handle_rpc_call (conn=0xac4028, msg=0xaba088) at ../../../../rpc/rpc-lib/src/rpcsvc.c:1159
#4  0x00007f8380cee382 in rpcsvc_notify (trans=0xac46a8, mydata=0xac4028, event=RPC_TRANSPORT_MSG_RECEIVED, data=0xaba088)
    at ../../../../rpc/rpc-lib/src/rpcsvc.c:1205
#5  0x00007f8380cf2d60 in rpc_transport_notify (this=0xac46a8, event=RPC_TRANSPORT_MSG_RECEIVED, data=0xaba088)
    at ../../../../rpc/rpc-lib/src/rpc-transport.c:1123
#6  0x00007f837e9dac7f in socket_event_poll_in (this=0xac46a8) at ../../../../../rpc/rpc-transport/socket/src/socket.c:1411
#7  0x00007f837e9dafbe in socket_event_handler (fd=8, idx=2, data=0xac46a8, poll_in=1, poll_out=0, poll_err=0)
    at ../../../../../rpc/rpc-transport/socket/src/socket.c:1521
#8  0x00007f8380f397e6 in event_dispatch_epoll_handler (event_pool=0xab99e8, events=0xac2fe8, i=0)
    at ../../../libglusterfs/src/event.c:812
#9  0x00007f8380f399da in event_dispatch_epoll (event_pool=0xab99e8) at ../../../libglusterfs/src/event.c:876
#10 0x00007f8380f39cb6 in event_dispatch (event_pool=0xab99e8) at ../../../libglusterfs/src/event.c:984
#11 0x000000000040587c in main (argc=1, argv=0x7fffba1f1078) at ../../../glusterfsd/src/glusterfsd.c:1297
Current language:  auto
The current source language is "auto; currently asm".

(gdb) up
#1  0x00007f837ec10bf5 in pmap_registry_search (this=0xabe648, brickname=0xac4b40 "/tmp/export/000/")
    at ../../../../../xlators/mgmt/glusterd/src/glusterd-pmap.c:116
116	                if (strcmp (pmap->ports[p].brickname, brickname) == 0) {
Current language:  auto
The current source language is "auto; currently c".
(gdb) p p
$3 = 6969
(gdb) p *pmap
$4 = {base_port = 6969, last_alloc = 6969, ports = {{used = 1, brickname = 0xac4090 "/tmp/export/000/"}, {used = 0, 
      brickname = 0x0} <repeats 20 times>, {used = 1, brickname = 0x0}, {used = 1, brickname = 0x0}, {used = 0, 
      brickname = 0x0}, {used = 0, brickname = 0x0}, {used = 1, brickname = 0x0}, {used = 0, 
      brickname = 0x0} <repeats 27 times>, {used = 1, brickname = 0x0}, {used = 0, brickname = 0x0} <repeats 26 times>, {
      used = 1, brickname = 0x0}, {used = 0, brickname = 0x0} <repeats 30 times>, {used = 1, brickname = 0x0}, {used = 0, 
      brickname = 0x0} <repeats 277 times>, {used = 1, brickname = 0x0}, {used = 0, brickname = 0x0} <repeats 241 times>, {
      used = 1, brickname = 0x0}, {used = 0, brickname = 0x0} <repeats 388 times>, {used = 1, brickname = 0x0}, {used = 1, 
      brickname = 0x0}, {used = 1, brickname = 0x0}, {used = 1, brickname = 0x0}, {used = 0, 
      brickname = 0x0} <repeats 1293 times>, {used = 1, brickname = 0x0}, {used = 0, brickname = 0x0} <repeats 4651 times>, 
    {used = 1, brickname = 0x0}, {used = 1, brickname = 0x0}, {used = 0, brickname = 0x0} <repeats 26535 times>, {used = 1, 
      brickname = 0x0}, {used = 0, brickname = 0x0} <repeats 1546 times>, {used = 1, brickname = 0x0}, {used = 0, 
      brickname = 0x0}, {used = 0, brickname = 0x0}, {used = 0, brickname = 0x0}, {used = 0, brickname = 0x0}, {used = 0, 
      brickname = 0x0}, {used = 1, brickname = 0x0}, {used = 0, brickname = 0x0} <repeats 9958 times>, {used = 1, 
      brickname = 0x0}, {used = 0, brickname = 0x0} <repeats 1752 times>, {used = 1, brickname = 0x0}, {used = 0, 
      brickname = 0x0} <repeats 5901 times>, {used = 1, brickname = 0x0}, {used = 0, 
      brickname = 0x0} <repeats 12862 times>}}
(gdb) l
111	        int                   port = 0;
112	
113	        pmap = pmap_registry_get (this);
114	
115	        for (p = pmap->base_port; p < 65535; p++) {
116	                if (strcmp (pmap->ports[p].brickname, brickname) == 0) {
117	                        port = p;
118	                        break;
119	                }
120	        }
(gdb)
Comment 3 Anand Avati 2010-08-15 11:28:34 EDT
PATCH: http://patches.gluster.com/patch/4124 in master (portmapper: minor fixes)