Bug 893851

Summary: Probing an invalid host causes glusterd to crash
Product: [Community] GlusterFS Reporter: Jeff Darcy <jdarcy>
Component: glusterdAssignee: krishnan parthasarathi <kparthas>
Severity: high Docs Contact:
Priority: unspecified    
Version: mainlineCC: gluster-bugs, nsathyan, pkarampu
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
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 13:52:17 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 895528, 902218    

Description Jeff Darcy 2013-01-09 22:01:15 EST
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-09 22:36:32 EST
Comment 2 Vijay Bellur 2013-01-10 04:29:59 EST
CHANGE: http://review.gluster.org/4372 (glusterd: fix memory corruption when probe fails) merged in master by Vijay Bellur (vbellur@redhat.com)
Comment 3 Jeff Darcy 2013-01-22 07:29:46 EST
*** Bug 889382 has been marked as a duplicate of this bug. ***