Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 916439

Summary: glusterd crashes in xdr_string on NetBSD, fails to encode response on Linux
Product: [Community] GlusterFS Reporter: krishnan parthasarathi <kparthas>
Component: glusterdAssignee: krishnan parthasarathi <kparthas>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: gluster-bugs, manu, nsathyan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.4.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-24 17:40:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description krishnan parthasarathi 2013-02-28 04:42:01 UTC
Description of problem:

When peer-probe command is issued from a cluster to a (new) peer, glusterd on the
peer crashes while attempting to call xdr_string on an empty string on NetBSD and fails to encode the string on Linux (without a crash).

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Run gluster peer probe <host>
2. 
3.
  
Actual results:
glusterd on peer crashes or response encoding fails.

Expected results:
Neither glusterd should crash nor should xdr encoding fail.

Additional info:
Thanks Emmanuel for providing the backtrace on NetBSD,

#0  0xbb95424d in xdr_string () from /lib/libc.so.12
#1  0xbbb675ab in xdr_gd1_mgmt_probe_rsp (xdrs=0xbfbfdfe8,
objp=0xbfbfe178)
    at glusterd1-xdr.c:120
#2  0xbb8ce10a in xdr_sizeof () from /lib/libc.so.12
#3  0xb9d98ae8 in glusterd_serialize_reply (req=0xb9c01010,
arg=0xbfbfe178, 
    outmsg=0xbfbfe088, xdrproc=0xbbb674b8 <xdr_gd1_mgmt_probe_rsp>)
    at glusterd-utils.c:489
#4  0xb9d98c12 in glusterd_submit_reply (req=0xb9c01010, arg=0xbfbfe178,
    payload=0x0, payloadcount=0, iobref=0xb8c130b0, 
    xdrproc=0xbbb674b8 <xdr_gd1_mgmt_probe_rsp>) at glusterd-utils.c:544
#5  0xb9d842e9 in glusterd_handle_probe_query (req=0xb9c01010)
    at glusterd-handler.c:2058
#6  0xbbb753ad in rpcsvc_handle_rpc_call (svc=0xbb741320,
trans=0xb8c03800, 
    msg=0xb8c11100) at rpcsvc.c:549
#7  0xbbb75905 in rpcsvc_notify (trans=0xb8c03800, mydata=0xbb741320, 
    event=RPC_TRANSPORT_MSG_RECEIVED, data=0xb8c11100) at rpcsvc.c:644
#8  0xbbb78c7a in rpc_transport_notify (this=0xb8c03800, 
    event=RPC_TRANSPORT_MSG_RECEIVED, data=0xb8c11100) at
rpc-transport.c:495
#9  0xb9d5b03d in socket_event_poll_in (this=0xb8c03800) at
socket.c:2118
#10 0xb9d5b869 in socket_event_handler (fd=23, idx=13, data=0xb8c03800,
    poll_in=1, poll_out=0, poll_err=0) at socket.c:2230
#11 0xbbbd42b1 in event_dispatch_poll_handler (i=13, ufds=0xb8c9f080, 
    event_pool=0xbb741080) at event-poll.c:357
#12 event_dispatch_poll (event_pool=0xbb741080) at event-poll.c:436
#13 0xbbbb17e4 in event_dispatch (event_pool=0xbb741080) at event.c:113
#14 0x0804f4e2 in main (argc=3, argv=0xbfbfecac) at glusterfsd.c:1902

glusterd1-xdr.c:
         if (!xdr_string (xdrs, &objp->op_errstr, ~0))
                 return FALSE;

(gdb) print *xdrs
$1 = {x_op = XDR_ENCODE, x_ops = 0xbfbfdfc4, x_public = 0xb8c130b4 "", 
  x_private = 0xb8c121d0, x_base = 0xc <Address 0xc out of bounds>, 
  x_handy = 100}
(gdb) print objp->op_errstr
$2 = 0x0

Comment 1 krishnan parthasarathi 2013-02-28 04:43:46 UTC
Patch has been submitted by Emmanuel at http://review.gluster.org/4589

Comment 2 Vijay Bellur 2013-02-28 13:07:10 UTC
CHANGE: http://review.gluster.org/4589 (Do not call xdr_string() with a NULL error message) merged in master by Vijay Bellur (vbellur)

Comment 3 Vijay Bellur 2013-03-06 05:04:24 UTC
CHANGE: http://review.gluster.org/4629 (Do not call xdr_string() with a NULL error message) merged in release-3.4 by Vijay Bellur (vbellur)