Bug 1384968

Summary: cman_tool nodes -F addr segfaults when qdisk is present
Product: Red Hat Enterprise Linux 6 Reporter: Josef Zimek <pzimek>
Component: clusterAssignee: Christine Caulfield <ccaulfie>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.8CC: ccaulfie, cluster-maint, mjuricek, rhayden, rpeterso, teigland
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cluster-3.0.12.1-80.el6 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 09:26:44 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:
Attachments:
Description Flags
Patch
none
Patch to fix coverity (actually clang) error (and more) none

Description Josef Zimek 2016-10-14 12:43:51 UTC
Description of problem:

`cman_tool nodes -F id,name,addr` segfaults when qdisk is present because we attempt to obtain IP address of qdisk:


without qdisk:
--------------
# cman_tool nodes -F id,name,addr
1 virt-242 2620:52:0:2246:1800:ff:fe00:f2 
2 virt-243 2620:52:0:2246:1800:ff:fe00:f3


with qdisk:
-----------
# cman_tool nodes -F name
/dev/sda 
virt-242 
virt-243 


Works fine until "addr" parameter is used:

# cman_tool nodes -F id,name,addr
0 /dev/sda ,,,,,,,,,,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.
0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.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,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.
0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.
0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,
1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.
0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.
0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0.0,1.0.0Segmentation fault (core dumped)




Version-Release number of selected component (if applicable):
cman-3.0.12.1-78.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. set cluster with qdisk
2. run `cman_tool nodes -F id,name,addr`


Actual results:
segfault while getting IP address of qdisk

Expected results:
we wont check IP address of qdisk

Additional info:
maybe the qdisk should not be considered as node in `cman_tool nodes` or we need to make exception for qdisk and addr

Comment 3 Christine Caulfield 2016-10-14 14:26:48 UTC
Created attachment 1210565 [details]
Patch

I'm quite impressed this bug lasted all the way to RHEL 6.8.

an obvious and easy fix, of course.

Comment 5 Christine Caulfield 2016-10-17 08:20:57 UTC
Patch is upstream(FWIW)

commit b5c85f77a6e4dfd4237c12d4002464a429e5b59c
Author: Christine Caulfield <ccaulfie>
Date:   Fri Oct 14 15:28:42 2016 +0100

    cman_tool: Don't segfault when taking address of qdevice
    
    If cman_tool nodes -F addr is called when qdevice is active then
    cman_tool segfaults quite spectacularly when it tries to print
    the address of the qdevice 'node'
    
    Signed-off-by: Christine Caulfield <ccaulfie>

Comment 8 Christine Caulfield 2016-11-11 08:49:08 UTC
Coverity spotted a bug in this patch that needs a little more thought.

Comment 9 Christine Caulfield 2016-11-11 09:28:51 UTC
Created attachment 1219675 [details]
Patch to fix coverity (actually clang) error (and more)

This patch (on top of the previous one) fixes the clang-reported error and its causes

Comment 12 errata-xmlrpc 2017-03-21 09:26: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.

https://rhn.redhat.com/errata/RHBA-2017-0601.html