[systemd-devel] [systemd][cgroup in container] problem with cgroup hierarchy in container

Dariusz Michaluk d.michaluk at samsung.com
Thu Mar 6 01:51:43 PST 2014


On 05.03.2014 19:16, Lennart Poettering wrote:
> Oh, yuck! THis is weird. Can you get a gdb backtrac and/or valgrind run
> for this? Can't reproduce this here...

(gdb) run show
Starting program: /usr/bin/systemctl show
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Detaching after fork from child process 2090.
Failed to parse message: Operation not permitted

Program received signal SIGSEGV, Segmentation fault.
sd_bus_message_unref (m=0x80000000) at 
../src/libsystemd/sd-bus/bus-message.c:800
800	        m->n_ref--;
(gdb) bt
#0  sd_bus_message_unref (m=0x80000000) at 
../src/libsystemd/sd-bus/bus-message.c:800
#1  0x80043950 in sd_bus_message_unrefp (p=0xbfffedd8) at 
../src/libsystemd/sd-bus/bus-util.h:141
#2  show_one.3172 (verb=<optimized out>, bus=bus at entry=0x80098880, 
path=path at entry=0x8007548e "/org/freedesktop/systemd1", 
show_properties=show_properties at entry=true, 
new_line=new_line at entry=0xbffff18a,
     ellipsized=ellipsized at entry=0xbffff18b) at 
../src/systemctl/systemctl.c:3672
#3  0x8005957b in show (bus=0x80098880, args=0xbffff458) at 
../src/systemctl/systemctl.c:3965
#4  0x80007dbb in systemctl_main (bus_error=<optimized out>, 
argv=0xbffff454, argc=2, bus=0x80098880) at 
../src/systemctl/systemctl.c:6167
#5  main (argc=2, argv=0xbffff454) at ../src/systemctl/systemctl.c:6422

$ valgrind systemctl show
==2093== Command: systemctl show
==2093==
Failed to parse message: Operation not permitted
Assertion 'm->n_ref > 0' failed at 
../src/libsystemd/sd-bus/bus-message.c:799, function 
sd_bus_message_unref(). Aborting.
==2093==
==2093== HEAP SUMMARY:
==2093==     in use at exit: 13,362 bytes in 21 blocks
==2093==   total heap usage: 195 allocs, 174 frees, 26,020 bytes allocated
==2093==
==2093== LEAK SUMMARY:
==2093==    definitely lost: 0 bytes in 0 blocks
==2093==    indirectly lost: 0 bytes in 0 blocks
==2093==      possibly lost: 0 bytes in 0 blocks
==2093==    still reachable: 13,362 bytes in 21 blocks
==2093==         suppressed: 0 bytes in 0 blocks
==2093== Rerun with --leak-check=full to see details of leaked memory
==2093==
==2093== For counts of detected and suppressed errors, rerun with: -v
==2093== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Aborted


> What's the contents of /proc/1/cgroup in both cases (i.e. the nspawn and
> the libvrit-lxc case?)

systemd-nspawn:
# cat /proc/1/cgroup
10:perf_event:/
9:blkio:/
8:net_cls:/
7:freezer:/
6:devices:/machine.slice/machine-mycontainer.scope
5:memory:/
4:cpu,cpuacct:/
3:cpuset:/
2:name=systemd:/machine.slice/machine-mycontainer.scope

libvirt-lxc:
# cat /proc/1/cgroup
10:perf_event:/machine.slice/machine-lxc\x2dmycontainer.scope
9:blkio:/machine.slice/machine-lxc\x2dmycontainer.scope
8:net_cls:/machine.slice/machine-lxc\x2dmycontainer.scope
7:freezer:/machine.slice/machine-lxc\x2dmycontainer.scope
6:devices:/machine.slice/machine-lxc\x2dmycontainer.scope
5:memory:/machine.slice/machine-lxc\x2dmycontainer.scope
4:cpu,cpuacct:/machine.slice/machine-lxc\x2dmycontainer.scope
3:cpuset:/machine.slice/machine-lxc\x2dmycontainer.scope
2:name=systemd:/machine.slice/machine-lxc\x2dmycontainer.scope/machine.slice/machine-lxc\x2dmycontainer.scope

I don't know whether this is relevant, but I use a kernel with support 
for user namespace, but I don't use this in container.

--
Dariusz Michaluk
Samsung R&D Institute Poland
Samsung Electronics
d.michaluk at samsung.com


More information about the systemd-devel mailing list