Bug 902218

Summary: Probing an invalid host causes glusterd to crash
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Vidya Sakar <vinaraya>
Component: glusterdAssignee: krishnan parthasarathi <kparthas>
Status: CLOSED ERRATA QA Contact: Sachidananda Urs <surs>
Severity: high Docs Contact:
Priority: medium    
Version: 2.0CC: amarts, gluster-bugs, jdarcy, nsathyan, rfortier, rhs-bugs, sac, shaines, vbellur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.4.0qa8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 893851 Environment:
Last Closed: 2013-09-23 22:39:25 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: 893851    
Bug Blocks:    

Description Vidya Sakar 2013-01-21 07:37:35 UTC
+++ This bug was initially created as a clone of Bug #893851 +++

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.

--- Additional comment from Jeff Darcy on 2013-01-09 22:36:32 EST ---

http://review.gluster.org/#change,4372

--- Additional comment from Vijay Bellur on 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)

Comment 2 Amar Tumballi 2013-02-01 06:20:33 UTC
valid only for rhs-2.1.0... is now committed.

Comment 4 Scott Haines 2013-04-11 16:36:30 UTC
Per 04-10-2013 Storage bug triage meeting, targeting for Big Bend.

Comment 5 Sachidananda Urs 2013-08-01 07:21:43 UTC
Verified on: glusterfs 3.4.0.14rhs built on Jul 30 2013 09:09:36

Crash is not seen.

Comment 6 Scott Haines 2013-09-23 22:39:25 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. 

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1262.html

Comment 7 Scott Haines 2013-09-23 22:43:44 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. 

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1262.html