Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 853083

Summary: ccs_tool update with non-valid cluster.conf suceeds but leads to segmentation fault in clustat
Product: Red Hat Enterprise Linux 5 Reporter: michal novacek <mnovacek>
Component: rgmanagerAssignee: Ryan McCabe <rmccabe>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: low Docs Contact:
Priority: low    
Version: 5.9CC: cluster-maint, edamato, fdinitto, jharriga, mjuricek
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rgmanager-2.0.52-51.el5 Doc Type: Bug Fix
Doc Text:
When a cluster configuration file was invalid, an attempt to run the "clustat" command failed with a segmentation fault. This bug has been fixed with this update and "clustat" no longer crashes in the described scenario.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-16 00:28:43 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: 1049888    
Attachments:
Description Flags
clustat core file none

Description michal novacek 2012-08-30 13:10:10 UTC
Created attachment 608183 [details]
clustat core file

Description of problem:
I have correctly running cluster. I change cluster.conf on one of the nodes with non-valid xml. I run ccs_tool to update this config version to all the nodes which it correctly does. Running "clustat" after that on any of the nodes leads to Segmentation Fault.

Version-Release number of selected component (if applicable):
This is RHEL5.9-candidate-20120813, rgmanager-2.0.52-34, running on ia64.

How reproducible:
Always.

Steps to Reproduce:
1. Have three node cluster on rhel5.9 ia64.
2. Modify /etc/cluster/cluster.conf on any of the nodes as follows (add <a> tag and increase config_version):
<?xml version="1.0"?>
<a>
    <cluster name="a_cluster" config_version="303">
	...
    </cluster>
</a>

3. run: ccs_tool update /etc/cluster/cluster.conf
4. check that all nodes report that the config has been updated correctly.
5. run: clustat
  
Actual results:
Segmentation Fault (core dumped)

Expected results:
Cluster status shown.

Additional info:
Info from the core attached: 

Core was generated by `clustat'.
Program terminated with signal 11, Segmentation fault.
#0  0x2000000000259890 in strcmp () from /lib/libc.so.6.1
(gdb) bt full
#0  0x2000000000259890 in strcmp () from /lib/libc.so.6.1
No symbol table info available.
#1  0x4000000000007b40 in add_missing (all=0x600000000000d9f0, these=0x600000000000d600) at clustat.c:396
        x = 0
        y = 0
        addflag = 0
        m = 0x0
        nn = 0x0
#2  0x400000000000c350 in build_member_list (ch=0x600000000000c010, lid=0x60000fffffd6b758) at clustat.c:983
        all = 0x600000000000d9f0
        part = 0x600000000000d600
        m = 0x0
        root = 1
        x = 0
#3  0x400000000000d190 in main (argc=1, argv=0x60000fffffd6ba88) at clustat.c:1173
        qs = 1
        ret = 0
        membership = 0x200000000004f378
        rgs = 0x0
        local_node_id = -2705464
        fast = 0
        runtype = 0
        now = 2305843009215291960
        ch = 0x600000000000c010
        ci = {ci_name = "a_cluster\000\000\000\000\000\000\000", ci_number = 50356, ci_generation = 512}
        refresh_sec = 0
        errors = 0
        opt = -1
        xml = 0
        flags = 0
        member_name = 0x0
        rg_name = 0x0
        real_rg_name = "\000\000\000\000\340\343\004\000\000\000\000 @\267\326\377\377\017\000`", '\000' <repeats 40 times>, "8b\030"
(gdb) info threads
* 1 Thread 0x20000000000ada60 (LWP 31939)  0x2000000000259890 in strcmp () from /lib/libc.so.6.1

Comment 5 Ryan McCabe 2014-03-13 18:26:26 UTC
commit fde6e0e3a1fc1dac3b95d7cd96315bb2231ccfd5
Author: Ryan McCabe <rmccabe>
Date:   Thu Mar 13 14:24:50 2014 -0400

    rgmanager: Fix for clustat crash when using an invalid config
    
    Fix for a crash in clustat when executed with an invalid cluster
    configuration file.
    
    Resolves: rhbz#853083
    
    Signed-off-by: Ryan McCabe <rmccabe>

Comment 10 errata-xmlrpc 2014-09-16 00:28:43 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-2014-1207.html