make / libc segfault in all arch linux containers

1

I'm getting the following when I run make (from any directory with or without a makefile):

(gdb) run
Starting program: /usr/bin/make 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff73050ca in strlen () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff73050ca in strlen () from /usr/lib/libc.so.6
#1  0x00007ffff7304dfe in strdup () from /usr/lib/libc.so.6
#2  0x0000000000418d89 in xstrdup ()
#3  0x0000000000423c33 in define_variable_in_set ()
#4  0x000000000040737b in main ()

I created the container with lxc-create -n $name -t /usr/share/lxc/templates/lxc-archlinux. I also have various containers I made a few months ago which are having the same problem (make seg faults) but are otherwise operating perfectly (make was working when I first made them).

Output from lxc-checkconfig only shows the following missing, which I believe was the same a few months ago when everything worked:

User namespace: missing
checkpoint restore: missing

This is running on a fully up-to-date x86 arch linux server. What's wrong / how can I debug this?

Edit: The error went away for 10 minutes on a couple of sessions, and I managed to compile the thing I wanted to compile, but now it's seg faulting again.

cronburg

Posted 2016-01-18T20:17:19.033

Reputation: 547

It's… funny, because I'm getting exactly the same thing in my fresh Debian SID chroot. – liori – 2016-01-21T19:40:56.240

I haven't tested this further, but my theory now is that it has to do with running anything systemd related inside of any container. Namely I would reboot the server and start my containers one-by-one. Once I enabled one of the containers with an apache systemd service, all of the containers seg fault on make. Will look into further sometime in the next couple days. – cronburg – 2016-01-21T19:53:34.397

Not here. Just tested a fresh Debian stretch chroot (current testing; systemd-based), and it works fine. So either our problems are different after all, or there was a very recent change in both distributions that results in this problem. But the fact that my stack trace is exactly the same as yours (modulo offsets) would mean it's likely it's the same bug. And the only systemd instance I'm running on this box is the host's. – liori – 2016-01-21T21:01:56.800

1

I've submitted a bug against debian make package here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812244. I noticed the bug was introduced in Debian make 4.1, and everything looks fine in make 4.0; could you try installing some earlier make and test?

– liori – 2016-01-21T21:41:05.363

chrooted into a container to make make 4.0 and that version works now (while the still installed 4.1-1 segfaults). – cronburg – 2016-01-21T21:56:05.270

Answers

0

A bug in make 4.1 related to having ttyname() returning NULL, e.g. when /dev/pts is not mounted in chroot/container, results in these symptomps. Thanks to make developer Paul D. Smith for fixing it and Debian maintainer Manoj Srivastava for diagnosing it.

liori

Posted 2016-01-18T20:17:19.033

Reputation: 3 044

As a side note - I just remembered / noticed that some of my containers have a bashrc with mesg n in them, which echos mesg: ttyname failed: Success every time I log in to them. So this is definitely the cause (for me). – cronburg – 2016-01-22T17:22:51.660

-1

Try reinstalling base-devel by executing

pacman -Syu base-devel

Otherwise, reinstall...

Derrick Fountain

Posted 2016-01-18T20:17:19.033

Reputation: 1

Tried that to no avail / the problem occurs on newly created containers as well. – cronburg – 2016-01-18T20:23:22.737