lxd is a real pleasure to use, but mdadm constantly segmentation faults inside Ubuntu guest operating system. This issue affects only Ubuntu as mdadm is not disabled by default inside these containers. It is nothing scary or dangerous, but in this specific case, repetitive segfaults needlessly raise alertness level.

Distribution-specific information.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.2 LTS
Release:	16.04
Codename:	xenial

The container hypervisor client/daemon version.

$ lxc --version

Segmentation fault found in dmesg output. The number of similar messages will increase proportionately to the number of containers running Ubuntu.

[2537326.715829] mdadm[2842]: segfault at 0 ip 00007fbc6e10db96 sp 00007ffcca7a68d8 error 4 in libc-2.23.so[7fbc6e083000+1bf000]

Authenticate the user if necessary.

$ sudo -v

Remove mdadm package from guest containers to get rid of the problem.

$ for i in $(sudo lxc list -c n | awk 'NR%2==0 && NR>2 {print $2}'); do sudo lxc exec $i -- apt-get remove -y mdadm; done

Sleep well.