[Gluster-devel] DHT NULL pointer usage

Emmanuel Dreyfus manu at netbsd.org
Mon Nov 17 12:20:56 UTC 2014


Hello

I have an almost reliable test that fails on NetBSD:

> ./tests/basic/ec/quota.t                 (Wstat: 0 Tests: 22 Failed: 3)
>   Failed tests:  19-21

This one is a real bug: glusterfsd crashed because of a NULL pointer. I
am going to submit a change to avoid touhcing postbuf is op_ret = -1 but
if someone has a better idea, please let me know.

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0xb9c08d10 in dht_writev_cbk (frame=0xb9438d08, cookie=0xb9438d98, 
    this=0xbb2de018, op_ret=-1, op_errno=2, prebuf=0x0, postbuf=0x0,
xdata=0x0)
    at dht-inode-write.c:59
59              if (IS_DHT_MIGRATION_PHASE2 (postbuf)) {

#0  0xb9c08d10 in dht_writev_cbk (frame=0xb9438d08, cookie=0xb9438d98, 
    this=0xbb2de018, op_ret=-1, op_errno=2, prebuf=0x0, postbuf=0x0,
xdata=0x0)
    at dht-inode-write.c:59
#1  0xbb767134 in default_writev_cbk ()
   from /autobuild/install/lib/libglusterfs.so.0
#2  0xb9c5ec5a in ec_manager_writev (fop=0xb9ae7028, state=-6)
    at ec-inode-write.c:2128
#3  0xb9c3e6a2 in __ec_manager (fop=0xb9ae7028, error=2) at
ec-common.c:1472
#4  0xb9c3bc89 in ec_resume (fop=0xb9ae7028, error=0) at ec-common.c:305
#5  0xb9c61cd4 in ec_combine (cbk=0xb942e028, 
    combine=0xb9c5e032 <ec_combine_writev>) at ec-combine.c:884
#6  0xb9c5e3bc in ec_writev_cbk (frame=0xb9ae8670, cookie=0x2, 
    this=0xbb2dd018, op_ret=-1, op_errno=2, prebuf=0xbf7fe3b0, 
    postbuf=0xbf7fe348, xdata=0x0) at ec-inode-write.c:1943
#7  0xb9cdd370 in client3_3_writev_cbk (req=0xbb217028, iov=0xbb217048,
    count=1, myframe=0xb9438be8) at client-rpc-fops.c:856
#8  0xbb730e3e in rpc_clnt_handle_reply (clnt=0xbb2b4148,
pollin=0xb9a17488)
    at rpc-clnt.c:766
#9  0xbb731136 in rpc_clnt_notify (trans=0xb9a0e018, mydata=0xbb2b4168,
    event=RPC_TRANSPORT_MSG_RECEIVED, data=0xb9a17488) at rpc-clnt.c:894
#10 0xbb72d831 in rpc_transport_notify (this=0xb9a0e018, 
    event=RPC_TRANSPORT_MSG_RECEIVED, data=0xb9a17488) at
rpc-transport.c:516
#11 0xb9d6d832 in socket_event_poll_in (this=0xb9a0e018) at
socket.c:2233
#12 0xb9d6dce7 in socket_event_handler (fd=16, idx=4, data=0xb9a0e018, 
    poll_in=1, poll_out=0, poll_err=0) at socket.c:2346
#13 0xbb7bd637 in event_dispatch_poll_handler ()
   from /autobuild/install/lib/libglusterfs.so.0
#14 0xbb7bd89e in event_dispatch_poll ()
   from /autobuild/install/lib/libglusterfs.so.0
#15 0xbb790329 in event_dispatch ()
   from /autobuild/install/lib/libglusterfs.so.0
#16 0x080503e0 in main (argc=6, argv=0xbf7feb50) at glusterfsd.c:2043

The NULL postbuf comes from ec_manager_writev(), this is 7th arg of
fop->cbks.writev():

2126                if (fop->cbks.writev != NULL)
2127                {
2128                    fop->cbks.writev(fop->req_frame, fop, fop->xl,
-1,
fop->error,
2129                                     NULL, NULL, NULL);
2130                }
2131    

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu at netbsd.org


More information about the Gluster-devel mailing list