[lxc-devel] update from LXC 1.1.5 to 2.0.7: command hangs

Thomas Jarosch thomas.jarosch at intra2net.com
Wed Feb 1 13:53:05 UTC 2017


On Wednesday, 1. February 2017 11:23:35 Thomas Jarosch wrote:
> #################
> cat > lxc_hang.sh << EOF
> /usr/bin/timeout 5s /usr/bin/lxc-attach -n amavisd -- /bin/true
> EOF
> chmod a+rx lxc_hang.sh
> 
> # works - executed directly
> /usr/bin/timeout 5s /usr/bin/lxc-attach -n amavisd -- /bin/true
> 
> # hangs until timeout
> ./lxc_hang.sh
> #################
> 
> Removing the "timeout 5s" helps.
> Also running "timeout --foreground 5s" works.
> (--foreground is a TTY related cmdline switch)
> 
> strace output when the error occurs:
> --------------------------
> ..
> -icanon -echo ...}) = ? ERESTARTSYS (To be r 24187 --- SIGTTOU (Stopped
> (tty output)) @ 0 (0) ---
> ..
> --------------------------

even better: a gdb backtrace when it's stuck:

(gdb) bt
#0  0xb76fa428 in __kernel_vsyscall ()
#1  0xb754bc4b in *__GI_tcsetattr (fd=5, optional_actions=2, 
termios_p=0xbfe755a0)
    at ../sysdeps/unix/sysv/linux/tcsetattr.c:83
#2  0xb76905f4 in lxc_setup_tios (fd=5, oldtios=0x9f73d00) at console.c:277
#3  0xb769147b in lxc_console_peer_default (console=0x9f714a0) at 
console.c:456
#4  lxc_console_create (conf=0x9f71420) at console.c:527
#5  0x080497bb in get_pty_on_host (pid=0xbfe7570c, wrap=0xbfe756e8, 
c=0x9f71288) at tools/lxc_attach.c:315
#6  main (argc=5, argv=0xbfe757d4) at tools/lxc_attach.c:463

-> looks like lxc-attach is stuck in glibc for whatever reason.


Also an interesting note in the man page of "tcsetattr":
---------------
Note  that  tcsetattr() returns success if any of the requested changes 
could be successfully carried out. Therefore, when making multiple changes 
it may be necessary to follow this call with a further call to tcgetattr() 
to check that all changes have been performed successfully.
---------------

lxc_setup_tios() doesn't verify if all flags are set properly.
Thought that's not the source of the trouble here.

Cheers,
Thomas



More information about the lxc-devel mailing list