[systemd-devel] Assert hit when more than one unit uses the same ControlGroup= value

Colin Guthrie gmane at colin.guthr.ie
Wed Apr 4 14:37:23 PDT 2012


Hi,

While playing with a little round-robin unit setup (two units that
conflict with each other but enable themselves by installing the same
alias), I stumbled across this assertion in pid 1.

Apr  4 22:10:06 jimmy systemd[1]: Assertion 'f =
hashmap_get(b->unit->manager->cgroup_bondings, b->path)' failed at
src/cgroup.c:72, function cgroup_bonding_free(). Aborting.

Ultimately it is caused by having two units in the unit paths that both
have the same ControlGroup= directive set.

e.g. I had two units: crash-a.service and crash-b.service which both had:
ControlGroup=/system/crash.service

Simply doing a daemon-reload was then enough to cause a crash.

I guess the hashmap for clearing the cgroup_bonding should only be
removed when the last unit that needs it is unloaded. That is presumably
the correct fix rather than just ignoring the assert (I presume there
would be some ramifications if it's cleared in unit_free when some other
unit might still need it?).


Backtrace (tho' likely not needed as I'm sure the general cause is clear
enough).

#0  0x0000003ceba0ee3b in raise (sig=<optimized out>) at
../nptl/sysdeps/unix/sysv/linux/pt-raise.c:42
#1  0x000000000040af8c in crash (sig=6) at src/main.c:123
#2  <signal handler called>
#3  0x0000003ceb634245 in __GI_raise (sig=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#4  0x0000003ceb6357cb in __GI_abort () at abort.c:93
#5  0x0000000000452249 in log_assert (text=<optimized out>,
file=0x492d75 "src/cgroup.c", line=72, func=0x493090 "cgroup_bonding_free",
    format=<optimized out>) at src/log.c:637
#6  0x00000000004527c0 in log_assert_failed (text=<optimized out>,
file=<optimized out>, line=<optimized out>, func=<optimized out>)
    at src/log.c:642
#7  0x00000000004415a6 in cgroup_bonding_free (b=0x26b61a0, trim=false)
at src/cgroup.c:72
#8  0x00000000004415f6 in cgroup_bonding_free_list (first=<optimized
out>, remove_or_trim=false) at src/cgroup.c:94
#9  0x0000000000465296 in unit_free (u=0x2a9f830) at src/unit.c:378
#10 0x000000000040b858 in manager_clear_jobs_and_units (m=0x26989e0) at
src/manager.c:441
#11 0x0000000000410fbf in manager_reload (m=0x26989e0) at src/manager.c:2900
#12 0x0000000000409306 in main (argc=<optimized out>, argv=<optimized
out>) at src/main.c:1505

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: systemd.bt.txt
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20120404/357badc9/attachment-0001.txt>


More information about the systemd-devel mailing list