Bug 893851

Summary: Probing an invalid host causes glusterd to crash
Product: [Community] GlusterFS Reporter: Jeff Darcy <jdarcy>
Component: glusterdAssignee: krishnan parthasarathi <kparthas>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: mainlineCC: gluster-bugs, nsathyan, pkarampu
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:
: 902218 (view as bug list) Environment:
Last Closed: 2013-07-24 17:52:17 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:
Bug Depends On:    
Bug Blocks: 895528, 902218    

Description Jeff Darcy 2013-01-10 03:01:15 UTC
This is causing regression tests to fail most of the time at step 12 of bug-879490.t and is also readily reproducible in isolation.  The problem is that we're adding the new peer to our peer list *after* calling glusterd_friend_rpc_create.  Unfortunately, by that time the disconnect-notify callback associated with our new  RPC object might already have been invoked, removing *and freeing* the new peer.  Thus, we add it after freeing it, leading to a corrupt list and a likely future crash - most often in glusterd_op_ac_send_lock while deleting the volume.  The test fails because glusterd disconnects and dies in mid-operation.

The fix is to change the order of addition to and deletion from the peer list.  In the process, the general control flow of glusterd_friend_add was simplified so that it's not only correct but more readily verified to be so.

Comment 1 Jeff Darcy 2013-01-10 03:36:32 UTC
http://review.gluster.org/#change,4372

Comment 2 Vijay Bellur 2013-01-10 09:29:59 UTC
CHANGE: http://review.gluster.org/4372 (glusterd: fix memory corruption when probe fails) merged in master by Vijay Bellur (vbellur)

Comment 3 Jeff Darcy 2013-01-22 12:29:46 UTC
*** Bug 889382 has been marked as a duplicate of this bug. ***