Summary: | systemd-cgls shows 'n/a' for when piping output less or more | ||
---|---|---|---|
Product: | systemd | Reporter: | Shawn Starr <shawn.starr> |
Component: | general | Assignee: | systemd-bugs |
Status: | RESOLVED FIXED | QA Contact: | systemd-bugs |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Patch to handle failed columns detection. |
Description
Shawn Starr
2012-11-01 17:00:30 UTC
What version is this? I tried to reproduce the problem on 195 (latest in f18) but I cannot. I do not see the n/a with any of "systemd-cgls", "systemd-cgls | less", or "systemd-cgls | more". Both your examples use "$ systemd-cgls | less". I assume one of them should have been different? systemd-libs-195-2.fc18.x86_64 systemd-sysv-195-2.fc18.x86_64 systemd-libs-195-2.fc18.i686 systemd-195-2.fc18.x86_64 195 Yes, w/o less it will show properly so: $ systemd-cgls ├ user │ └ foo │ └ 2 │ ├ 1176 gdm-session-worker [pam/gdm-password] │ ├ 1183 /bin/sh /usr/bin/startkde │ ├ 1192 dbus-launch --sh-syntax --exit-with-session $ systemd-cgls | less ├ user │ └ foo │ └ 2 │ ├ 1176 n/a │ ├ 1183 n/a │ ├ 1192 n/a Some more information. which may or may not be relevant I am using Huge Pages my sysctl.d config: 107 = qemu group # Test - Use HugePageTables vm.nr_hugepages = 512 vm.hugetlb_shm_group = 107 # Kernel tweaks kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.shmall = 1048576 cgroup mounts: $ mount | grep cgroup tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset) cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu) cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory) cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls) cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio) cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event) Created attachment 69696 [details] [review] Patch to handle failed columns detection. This looks like the same problem I'm having. I have attached a patch that solves it for me. The problem is that terminal width detection fails (fd_columns() in src/shared/util.c) but the calling function (columns() in src/shared/util.c) doesn't handle signed values and returns 4294967273 as the number of columns. When the fault column number is passed along to get_process_cmdline() (in src/shared/util.c) it fails to allocate memory for a string that wide resulting in a null pointer that is printed as "n/a". Fault exists in version 195 but not in 194. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.