cgrulesengd cannot process symlinked executables

Bug #1188850 reported by ojab
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libcgroup (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Serge Hallyn

Bug Description

Oh hai!

I've found that 0.37.1-1ubuntu10 in precise/LTS cannot process symlinked executables correctly, the testcase is
>$ python -c "import time; time.sleep(2)" & cgclassify $!
>Error in determining process name of pid 9738

The issue was fixed upstream in v0.38, see https://sourceforge.net/p/libcg/libcg/ci/acbed86127d5d81d082fa5b90cac13a4f84f877e

It will be awesome if the patch will be applied to v0.37 in precise/LTS, because right now cgrulesengd/cgclassify are basically unusable.

==============================
SRU Justification:
1. Impact: symlinked executables cannot be classified
2. Development fix: in the case of a symlink, read the real
   file path from /proc/self/exe
3. Stable fix: cherrypick small patch from development fix.
4. Test case: see comment #5.
5. Regression potential: there should be none, as this fix is
   taken straight from upstream and only affects the path when
   a symbolic link is being run (which is already broken).
==============================

ojab (ojab)
description: updated
Revision history for this message
ojab (ojab) wrote :
Changed in libcgroup (Ubuntu):
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug and pointing to the nice simple fix. I"ll work on SRUing this.

Would you mind adding a detailed test case to the description? (The symlinking part is fine, but the configuration file plus a neat way to determine that the task failed to be reclassified.)

Changed in libcgroup (Ubuntu):
status: Confirmed → Fix Released
importance: Wishlist → High
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Jon,

I'm only allowed to nominate this bug for precise. Could you please accept the nomination, and, if you have time, complete the SRU (else shout and I'll continue with it).

Revision history for this message
Jon Bernard (jbernard) wrote :

@Serge I see your nomination, but it's unclear to me how to accept it. Can you give me a pointer?

Revision history for this message
ojab (ojab) wrote :

Sorry for delay, simple testcase:

sudo cgcreate -g memory:/
sudo cgcreate -g memory:/test
echo "`whoami`:python2.7 memory test/" | sudo tee -a /etc/cgrules.conf
/usr/bin/env python -c "import time; time.sleep(2)" &
export PID=$!
sudo cgclassify $PID
grep $PID /sys/fs/cgroup/memory/{,*/}cgroup.procs

In case of fixed libcgroup output will be something like
>/sys/fs/cgroup/memory/test/cgroup.procs:5778

Right now it is
>Error in determining process name of pid 2042
>/sys/fs/cgroup/memory/sysdefault/cgroup.procs:2042

Changed in libcgroup (Ubuntu Precise):
status: New → In Progress
assignee: nobody → Serge Hallyn (serge-hallyn)
importance: Undecided → High
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks, ojab - tried out your testcase, worked like a charm. (For manual reproduction, I'd recommend sleeping 20 rather than 2)

description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello ojab, or anyone else affected,

Accepted libcgroup into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/libcgroup/0.37.1-1ubuntu10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in libcgroup (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
ojab (ojab) wrote :

The issue is fixed in libcgroup1/cgroup-bin-0.37.1-1ubuntu10.1.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libcgroup - 0.37.1-1ubuntu10.1

---------------
libcgroup (0.37.1-1ubuntu10.1) precise-proposed; urgency=low

  * debian/patches/libcgroup_sumlinked_bin.patch: fix handling of symlinked
    executables. (LP: #1188850)
 -- Serge Hallyn <email address hidden> Wed, 12 Jun 2013 08:46:20 -0500

Changed in libcgroup (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.