Bug 977854
| Summary: | "ps xawf -eo pid,user,cgroup,args" segfaults with very long cgroup names | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Brian Bockelman <bbockelm> | ||||
| Component: | procps | Assignee: | Jan Rybar <jrybar> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.4 | CC: | albert, bbockelm, bnater, kdudka | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2017-12-06 11:14:46 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
Brian Bockelman
2013-06-25 13:19:23 UTC
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate, in the next release of Red Hat Enterprise Linux. Hello Brian. Sorry, I'm unable to reproduce this on my workstation even when going up to 824 characters per /proc/self/cgroup. Could you please provide us with detailed reproduction scenario? Thanks in advance. Regards, Jaromir. Created attachment 1066368 [details]
Example output from valgrind of 'ps' segfaulting
Hi,
Sorry for the delay - have been on travel the last month.
See the attached output of "valgrind ps xawf -eo pid,user,cgroup,args"
Is it possible that I have more cgroup controllers mounted than you, causing the problem?
Thanks,
Brian
Hello Brian. Everything is possible till you find a reliable reproducer and till we get a clue what's wrong after debugging with gdb. Try to reproduce your system state in a virtual machine and provide me with exact step by step instructions if it gets you to the crashing state again. Thanks, Jaromir. Alright, try this:
1) Run "ps xawf -eo pid,user,cgroup,args" and make sure it exits without segfault.
2) Make sure at least the blkio, freezer, memory, cpuacct, and cpu controllers are mounted. For me, they are mounted at /cgroup.
3) Create a cgroup with an excessively long name mkdir -p /cgroup/{blkio,freezer,memory,cpuacct,cpu}/condor/condor_var_lib_condor_execute_slot1_2.ede
4) Add current shell to excessively long cgroup name:
- echo $$ > /cgroup/cpu/condor/condor_var_lib_condor_execute_slot1_2\@red-d9n3.unl.ede/tasks
- echo $$ > /cgroup/cpuacct/condor/condor_var_lib_condor_execute_slot1_2\@red-d9n3.unl.ede/tasks
- echo $$ > /cgroup/memory/condor/condor_var_lib_condor_execute_slot1_2\@red-d9n3.unl.ede/tasks
- echo $$ > /cgroup/freezer/condor/condor_var_lib_condor_execute_slot1_2\@red-d9n3.unl.ede/tasks
- echo $$ > /cgroup/blkio/condor/condor_var_lib_condor_execute_slot1_2\@red-d9n3.unl.ede/tasks
5) Run "ps xawf -eo pid,user,cgroup,args" again. This time, it should crash when it gets to the PID associated with your current shell.
I'm sorry. I did exactly what was written in #c6 and still get no crash. In my case the difference active_cols-actual-tmpspace never gets negative. In my case the active_cols is always equal to 131072 on the line 1843. The rest two values are too low to beat it (getting up to 681). Ah - what terminal are you using? I noticed that: ps xawf -eo pid,user,cgroup,args crashes but ps xawf -eo pid,user,cgroup,args | cat works (the latter has 'ps' outputting to a pipe and not a TTY). That indicates the issue might be related to terminal width. I'm currently using a 213x42 terminal with: # echo $TERM xterm-color The length of the cgroup longest column is 381 characters; I see a segfault at a terminal of width 252 characters and no longer at 253. (In reply to Brian Bockelman from comment #10) > Ah - what terminal are you using? I tried konsole, xfce4 terminal and xterm -> no crash. But when running the debug binary in xterm, the value really gets negative. So, at least this one got sorted out. Thanks. > I noticed that: > > ps xawf -eo pid,user,cgroup,args > > crashes but > > ps xawf -eo pid,user,cgroup,args | cat > > works (the latter has 'ps' outputting to a pipe and not a TTY). That > indicates the issue might be related to terminal width. I'm currently using > a 213x42 terminal with: I tried several widths and still getting no crash. But that could still be caused by differences in the environment. > # echo $TERM > xterm-color > > The length of the cgroup longest column is 381 characters; I see a segfault > at a terminal of width 252 characters and no longer at 253. Ok. I'll try several widths. Anyway, the code probably needs to be analysed. Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available. The official life cycle policy can be reviewed here: http://redhat.com/rhel/lifecycle This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL: https://access.redhat.com/ |