RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 916397 - cgrulesengd segmentation fault
Summary: cgrulesengd segmentation fault
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libcgroup
Version: 6.4
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: Peter Schiffer
QA Contact: Petr Beňas
URL:
Whiteboard:
Depends On:
Blocks: 947775
TreeView+ depends on / blocked
 
Reported: 2013-02-28 00:51 UTC by Benjamin Rose
Modified: 2018-12-01 15:02 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Clone Of:
Environment:
Last Closed: 2013-11-21 22:32:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
core dump (2.73 MB, application/octet-stream)
2013-02-28 17:28 UTC, Benjamin Rose
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 923851 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Product Errata RHBA-2013:1685 0 normal SHIPPED_LIVE libcgroup bug fix and enhancement update 2013-11-20 21:52:29 UTC

Internal Links: 923851

Description Benjamin Rose 2013-02-28 00:51:38 UTC
Description of problem:
After the update to 6.4, service cgred will not start properly. I ran it explicitly, here's what happens:

[root@bastion ~]# cgrulesengd -g cgred --debug
CGroup Rules Engine Daemon log started
Current time: Wed Feb 27 19:47:08 2013

Opened log file: -, log facility: 0,log level: 7
Proceeding with PID 5141
Rule: @csstaff
  UID: N/A
  GID: 910
  DEST: csstaff/
  CONTROLLERS:
    cpu
    blkio

Rule: @courseacct
  UID: N/A
  GID: 20563
  DEST: users/
  CONTROLLERS:
    cpu
    memory
    blkio

Rule: @fac
  UID: N/A
  GID: 920
  DEST: users/
  CONTROLLERS:
    cpu
    memory
    blkio

Rule: @grad
  UID: N/A
  GID: 930
  DEST: users/
  CONTROLLERS:
    cpu
    memory
    blkio

Rule: @guest
  UID: N/A
  GID: 931
  DEST: users/
  CONTROLLERS:
    cpu
    memory
    blkio

Rule: @research
  UID: N/A
  GID: 932
  DEST: users/
  CONTROLLERS:
    cpu
    memory
    blkio

Rule: @ug
  UID: N/A
  GID: 940
  DEST: users/
  CONTROLLERS:
    cpu
    memory
    blkio

Rule: @office
  UID: N/A
  GID: 960
  DEST: users/
  CONTROLLERS:
    cpu
    memory
    blkio

Rule: @ug_alumni
  UID: N/A
  GID: 970
  DEST: users/
  CONTROLLERS:
    cpu
    memory
    blkio

Rule: @grad_alumni
  UID: N/A
  GID: 980
  DEST: users/
  CONTROLLERS:
    cpu
    memory
    blkio

Rule: *
  UID: any
  GID: any
  DEST: system/
  CONTROLLERS:
    cpu
    blkio

Not using cached rules for PID 5141.
Parsing configuration file.
Segmentation fault (core dumped)

This is a good print out of my /etc/cgrules.conf:
[root@bastion ~]# cat /etc/cgrules.conf
@csstaff	cpu,blkio		csstaff/

@courseacct	cpu,memory,blkio	users/

@fac		cpu,memory,blkio	users/
@grad		cpu,memory,blkio	users/
@guest		cpu,memory,blkio	users/
@research	cpu,memory,blkio	users/
@ug		cpu,memory,blkio	users/
@office		cpu,memory,blkio	users/
@ug_alumni	cpu,memory,blkio	users/
@grad_alumni	cpu,memory,blkio	users/

*		cpu,blkio		system/

I got a core dump and installed the debug symbols. The problem is here:

Core was generated by `cgrulesengd -g cgred --debug'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007fb56d2445eb in cgroup_parse_rules (cache=false, muid=4294967294, mgid=4294967294, mprocname=0x0) at api.c:595
595				for (i = 0; grp->gr_mem[i]; i++) {
(gdb) bt
#0  0x00007fb56d2445eb in cgroup_parse_rules (cache=false, muid=4294967294, mgid=4294967294, mprocname=0x0) at api.c:595
#1  0x00007fb56d24517c in cgroup_change_cgroup_flags (uid=4294967294, gid=4294967294, procname=0x0, pid=4078, flags=<value optimized out>) at api.c:2458
#2  0x00007fb56d2452d2 in cgroup_search_rules_config () at api.c:2637
#3  0x0000000000403670 in main (argc=<value optimized out>, argv=0x7fff37705e68) at cgrulesengd.c:1252
(gdb) print i
$1 = 0
(gdb) print grp
$2 = (struct group *) 0x7fb56d02dc60
(gdb) print grp->gr_mem
$3 = (char **) 0x943010
(gdb) print muid
$4 = 4294967294
(gdb) print mgid
$5 = 4294967294

Also, yes cgconfig is running properly, and sssd is operating normally.

Any ideas?

Thanks for your time.

Version-Release number of selected component (if applicable):
libcgroup-0.37

How reproducible:
Always

Steps to Reproduce:
1. Run it
  
Actual results:
Segmentation fault

Expected results:
Runs normally

Additional info:

Comment 2 Ondrej Vasik 2013-02-28 08:23:05 UTC
Thank you for taking the time to enter a bug report with us. We appreciate the feedback and look to use reports such as this to guide our efforts at improving our products. That being said, this bug tracking system is not a mechanism for requesting support, and we are not able to  guarantee the timeliness or suitability of a resolution.

If this issue is critical or in any way time sensitive, please raise a ticket through your regular Red Hat support channels to make certain  it receives the proper attention and prioritization to assure a timely resolution. 

For information on how to contact the Red Hat production support team, please visit:
      https://www.redhat.com/support/process/production/#howto

Comment 3 Peter Schiffer 2013-02-28 16:50:06 UTC
Hi Benjamin,

what exact version of libcgroup do you have? You can see the version with:
$ rpm -q libcgroup

If you have libcgroup-0.37-7.el6 please try to update to libcgroup-0.37-7.1.el6_4 version and reproduce the problem.

Thanks.

peter

Comment 4 Benjamin Rose 2013-02-28 16:52:37 UTC
Hi Peter,

Yes I am using the 6.4 version:

[benrose@bastion ~]$ rpm -q libcgroup
libcgroup-0.37-7.1.el6_4.x86_64

The upgrade from the 6.3 to the 6.4 package is what broke my config.

Thanks,
Ben

Comment 5 Peter Schiffer 2013-02-28 17:04:13 UTC
Thanks. If you try to downgrade the package to the RHEL-6.3 version, with the rest of the packages from RHEL-6.4, to you still see the problem?
# yum downgrade libcgroup-0.37-4.el6

Comment 6 Benjamin Rose 2013-02-28 17:06:51 UTC
Peter,

Downgrading to libcgroup-0.37-4.el6 does indeed fix the problem.

Ben

Comment 7 Peter Schiffer 2013-02-28 17:23:24 UTC
OK. You can use the old version as workaround for a while.
Also, could you attach the complete coredump so we can analyse the problem more deeply? Thanks.

Comment 8 Benjamin Rose 2013-02-28 17:28:41 UTC
Created attachment 703929 [details]
core dump

Comment 9 RHEL Program Management 2013-03-04 06:47:26 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 11 Benjamin Rose 2013-03-06 17:52:07 UTC
Peter,

This appears to have fixed the segmentation fault, but now my /var/log/messages is overflowing with:

Mar  6 12:49:04 bastion CGRE[24168]: Warning: cannot write tid 24176 to /cgroup/cpu/system//tasks:No such process
Mar  6 12:49:04 bastion CGRE[24168]: Warning: cgroup_attach_task_pid failed: 50016
Mar  6 12:49:04 bastion CGRE[24168]: Warning: failed to apply the rule. Error was: 50016
Mar  6 12:49:04 bastion CGRE[24168]: Warning: cannot write tid 24180 to /cgroup/cpu/system//tasks:No such process
Mar  6 12:49:04 bastion CGRE[24168]: Warning: cgroup_attach_task_pid failed: 50016
Mar  6 12:49:04 bastion CGRE[24168]: Warning: failed to apply the rule. Error was: 50016
Mar  6 12:49:04 bastion CGRE[24168]: Warning: cannot write tid 24182 to /cgroup/cpu/system//tasks:No such process
Mar  6 12:49:04 bastion CGRE[24168]: Warning: cgroup_attach_task_pid failed: 50016
Mar  6 12:49:04 bastion CGRE[24168]: Warning: failed to apply the rule. Error was: 50016


Thanks,
Ben

Comment 12 Peter Schiffer 2013-03-07 17:12:35 UTC
Benjamin,

hm. This is enhanced logging system available in libcgroup since RHEL-6.4, but by default, only error messages should be logged. What contains your /etc/sysconfig/cgred.conf file?

peter

Comment 13 Benjamin Rose 2013-03-07 19:25:56 UTC
[root@bastion ~]# cat /etc/cgrules.conf 
@csstaff	cpu,blkio		csstaff/

@courseacct	cpu,memory,blkio	users/

@fac		cpu,memory,blkio	users/
@grad		cpu,memory,blkio	users/
@guest		cpu,memory,blkio	users/
@research	cpu,memory,blkio	users/
@ug		cpu,memory,blkio	users/
@office		cpu,memory,blkio	users/
@ug_alumni	cpu,memory,blkio	users/
@grad_alumni	cpu,memory,blkio	users/

*		cpu,blkio		system/






[root@bastion ~]# cat /etc/cgconfig.conf 
# See man cgconfig.conf for further details.
#
# By default, mount all controllers to /cgroup/<controller>

mount {
	cpuset	= /cgroup/cpuset;
	cpu	= /cgroup/cpu;
	cpuacct	= /cgroup/cpuacct;
	memory	= /cgroup/memory;
	devices	= /cgroup/devices;
	freezer	= /cgroup/freezer;
	net_cls	= /cgroup/net_cls;
	blkio	= /cgroup/blkio;
}

group . {
	perm {
		task {
			uid = root;
			gid = root;
		}
		admin {
			uid = root;
			gid = root;
		}
	}
	cpu {
	}
	blkio {
	}
}

group csstaff {
	cpu {
		cpu.shares = 20;
	}
	blkio {
		blkio.weight = 1000;
	}
}

group users {
	cpu {
		cpu.shares = 60;
	}
	memory {
		memory.limit_in_bytes = 40454789530;
		memory.memsw.limit_in_bytes = 40454789530;
	}
	blkio {
		blkio.weight = 100;
	}
}

group system {
	cpu {
		cpu.shares = 20;
	}
	blkio {
		blkio.weight = 1000;
	}
}

Comment 14 Benjamin Rose 2013-03-07 19:26:39 UTC
Sincere apologies, here is the file you actually asked for:

[root@bastion ~]# cat /etc/sysconfig/cgred.conf 
# /etc/sysconfig/cgred.conf - CGroup Rules Engine Daemon configuration file
# 
# The four options listed below (CONFIG_FILE, LOG_FILE, NODAEMON, LOG) are
# the only valid ones.  Defining anything else in this file will cause the
# CGroup Rules Engine program to fail.  So, don't do it.

# The pathname to the configuration file for CGroup Rules Engine
CONFIG_FILE="/etc/cgrules.conf"

# Uncomment the following line to log to specified file instead of syslog
#LOG_FILE="/var/log/cgrulesengd.log"

# Uncomment the second line to run CGroup Rules Engine in non-daemon mode
NODAEMON=""
#NODAEMON="--nodaemon"

# Set owner of cgred socket. 'cgexec' tool should have write access there
# (either using suid and/or sgid permissions or Linux capabilities).
SOCKET_USER=""
SOCKET_GROUP="cgred"

# Uncomment the second line to disable logging for CGroup Rules Engine
# Uncomment the third line to enable more verbose logging.
LOG=""
#LOG="--nolog"
#LOG="-v"

Comment 15 Peter Schiffer 2013-03-08 13:57:40 UTC
Hi Benjamin,

thanks. I'm sorry, I've lied to you. cgrulesengd has it's own default logging level which is WARNING and more severe messages. You can make it quieter by setting:
LOG="-q"
in /etc/sysconfig/cgred.conf file.

I'll think about how to unify this updated logging.

Thanks for bringing this up.

peter

Comment 27 Petr Beňas 2013-08-29 12:42:14 UTC
Reproduced in libcgroup-0.37-7.el6.x86_64 and verified in 
libcgroup-0.37-10.el6.x86_64.

Comment 28 errata-xmlrpc 2013-11-21 22:32:36 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-1685.html


Note You need to log in before you can comment on or make changes to this bug.