Bug 1011307

Summary: corosync gives segmentation fault if /dev/shm is full
Product: Red Hat Enterprise Linux 6 Reporter: Aarti Sawant <aartipsawant10>
Component: corosyncAssignee: Jan Friesse <jfriesse>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.4CC: ccaulfie, cluster-maint, fdinitto, jkortus
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: corosync-1.4.1-18.el6 Doc Type: Bug Fix
Doc Text:
Cause: Corosync started on system with full /dev/shm Consequence: Corosync segfault Fix: Handle logsys (this is not typo. logsys = corosync logging system) initialization properly. If logsys cannot be initialized, display error (stderr/syslog) and exit with error code (EXIT_FAILURE). Result: Corosync doesn't segfault. Displays proper error message and exit gracefully.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 07:11:35 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: 1055584    
Bug Blocks: 1005179    
Attachments:
Description Flags
Proposed patch - Handle full /dev/shm correctly
none
Proposed patch - Handle full /dev/shm correctly - take 2 none

Description Aarti Sawant 2013-09-24 04:28:40 UTC
Description of problem:
corosync service start giving segmentation fault on centos

Version-Release number of selected component (if applicable):
 glibc-2.12-1.107.el6_4.4.x86_64
 corosync-1.4.1-15.el6_4.1.x86_64
 pacemaker-1.1.8-7.el6.x86_64
 centos 6.4

How reproducible:
I am trying to start the corosync on centos 6.4 container

Steps to Reproduce:
1.create a lxc container 

my  lxc configuration file is test1.xml
<domain type='lxc'>
<name>test1</name>
<memory>102400</memory>
<os>
  <type>exe</type>
  <init>/sbin/init</init>
</os>
<vcpu>1</vcpu>
<devices>
<console type='pty'/>
<emulator>/usr/libexec/libvirt_lxc</emulator>
<filesystem type='mount' accessmode='passthrough'>
  <source dir='/lxc/test1/'/>
  <target dir='/'/>
</filesystem>
<interface type='bridge'>
  <source bridge='br0'/>
</interface>
</devices>
</domain>
                  

network settings on host     
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
BRIDGE="br0"
HWADDR="08:00:27:97:D6:35"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
UUID="fe9d7236-f418-47ab-b472-6e6caabdd807"

 
/etc/sysconfig/network-scripts/ifcfg-br0
DEVICE="br0"
TYPE="Bridge"
USERCTL="no"
ONBOOT="yes"
BOOTPROTO="dhcp"
NM_CONTROLLED="no"


network setting on host
/lxc/test1/etc/sysconfig/network-scripts/ifcfg-eth0
EVICE=eth0
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=dhcp
PREFIX=24
USERCTL=yes
IPV6INIT=no


2. install pacemaker and corosync
 yum --installroot=/lxc/test1 --releasever=6.4 install corosync pacemaker

3. start the corosync service
i get segmentaion fault

Actual results:
-bash-4.1# service corosync start
Starting Corosync Cluster Engine (corosync): /etc/init.d/corosync: line 85:
610 Segmentation fault      (core dumped) $prog > /dev/null 2>&1
                                                            [FAILED]

Expected results:
corosync service start without any segmentation fault

Additional info:

this is a backtrace of core dump of corosync

(gdb) run
Starting program: /usr/sbin/corosync
warning: linux_test_for_tracefork: failed to kill second child
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6e6250b in __memset_sse2 () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.107.el6_4.4.x86_64 libibverbs-1.1.6-5.el6.x86_64
librdmacm-1.0.17-0.git4b5c1aa.el6.x86_64 nspr-4.9.5-2.el6_4.x86_64
nss-3.14.3-4.el6_4.x86_64 nss-util-3.14.3-3.el6_4.x86_64
zlib-1.2.3-29.el6.x86_64
(gdb) bt
#0  0x00007ffff6e6250b in __memset_sse2 () from /lib64/libc.so.6
#1  0x00007ffff79a2764 in _logsys_rec_init (fltsize=<value optimized out>)
    at /usr/include/bits/string3.h:85
#2  0x0000000000406389 in logsys_system_init () at main.c:96
#3  0x0000000000410dc6 in __do_global_ctors_aux ()
#4  0x0000000000403c0b in _init ()
#5  0x00007fffffffe7a8 in ?? ()
#6  0x0000000000410d55 in __libc_csu_init ()
#7  0x00007ffff6dfcc70 in __libc_start_main () from /lib64/libc.so.6
#8  0x0000000000404539 in _start ()

Comment 2 Jan Friesse 2013-09-24 15:43:04 UTC
Created attachment 802319 [details]
Proposed patch - Handle full /dev/shm correctly

If /dev/shm was full, corosync was segfaulting instead of display
error.

Also when logsys is not initialized, error message was displayed
only on stderr. This is not ok if corosync is running as service
and solution is to send error also to syslog.

Comment 3 Jan Friesse 2013-09-25 13:51:36 UTC
Created attachment 802871 [details]
Proposed patch - Handle full /dev/shm correctly - take 2

Same as previous patch but exit code is < 128 (codes > 127 are reserved for signals)

Comment 8 errata-xmlrpc 2014-10-14 07:11:35 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-1508.html