lxc-attach crashed with SIGSEGV in get_pty_on_host()

Bug #1567037 reported by Philipp
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Installed unity8-lxc, ran unity8-setup, then rebooted.
Login to unity8 lxc session failed (somehow nothing happened), then I logged into Unity7 and the crash happened.

ProblemType: Crash
DistroRelease: Ubuntu 16.04
Package: lxc1 2.0.0~rc15-0ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-17.33-generic 4.4.6
Uname: Linux 4.4.0-17-generic x86_64
ApportVersion: 2.20.1-0ubuntu1
Architecture: amd64
Date: Wed Apr 6 20:11:34 2016
ExecutablePath: /usr/bin/lxc-attach
InstallationDate: Installed on 2015-12-03 (124 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Alpha amd64 (20151203)
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-4.4.0-17-generic.efi.signed root=UUID=dccfbc3c-48bc-43ed-9881-36efaa2ef6c5 ro quiet splash vt.handoff=7
SegvAnalysis:
 Segfault happened at: 0x563ee5318994 <main+884>: movl $0x1,0x1c(%r14)
 PC (0x563ee5318994) ok
 source "$0x1" ok
 destination "0x1c(%r14)" (0x0000001c) not located in a known VMA region (needed writable region)!
SegvReason: writing NULL VMA
Signal: 11
SourcePackage: lxc
Stacktrace:
 #0 0x0000563ee5318994 in main ()
 No symbol table info available.
StacktraceTop: main ()
ThreadStacktrace:
 .
 Thread 1 (Thread 0x7fe20540f840 (LWP 2993)):
 #0 0x0000563ee5318994 in main ()
 No symbol table info available.
Title: lxc-attach crashed with SIGSEGV in main()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

defaults.conf:
 lxc.network.type = veth
 lxc.network.link = lxcbr0
 lxc.network.flags = up
 lxc.network.hwaddr = 00:16:3e:xx:xx:xx

Revision history for this message
Philipp (philipp-pfahofa) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 get_pty_on_host (pid=0x7ffd0fac319c, wrap=0x7ffd0fac31d0, c=0x563ee74ca090) at lxc_attach.c:307
 main (argc=<optimized out>, argv=<optimized out>) at lxc_attach.c:444

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : StacktraceSource.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in lxc (Ubuntu):
importance: Undecided → Medium
summary: - lxc-attach crashed with SIGSEGV in main()
+ lxc-attach crashed with SIGSEGV in get_pty_on_host()
tags: removed: need-amd64-retrace
Changed in lxc (Ubuntu):
importance: Medium → High
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug. I haven't reproduced it, but marked it confirmed bc I see how it could happen.

A simple fix would be to not dereference ts without checking for it to be NULL. The question is whether we should be doing more at console_create to not honor lxc.console during attach.

information type: Private → Public
Changed in lxc (Ubuntu):
status: New → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Hi,

could you please attach the contents of the file /var/log/lxc/(container).log ?

Changed in lxc (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Philipp (philipp-pfahofa) wrote :

I did a fresh install of the latest daily build and still I am unable to log into the lxc session in from unity-greeter (same behaviour as before).
But now there is no more popup if I want to report a bug.

If I try 'sudo unity8-lxc-session' this happens:

lxc-attach: attach.c: lxc_attach: 730 failed to get the init pid
/usr/bin/unity8-lxc-session: 30: /usr/bin/unity8-lxc-session: cannot create /proc//root/etc/passwd: Directory nonexistent

Revision history for this message
Christian Brauner (cbrauner) wrote :

Hi,

could you please attach the contents of the file /var/log/lxc/(container).log as Serge suggested. That would be great.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

To be precise, the container name should be unity8-lxc. Please also show it's configuration file, and try

 lxc-ls -f
 lxc-start -n unity-lxc
and if that fails, then
 lxc-start -n unity-lxc -F -l trace -o output

and attach the file 'output'

Revision history for this message
Philipp (philipp-pfahofa) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Could you please show the results of:

ls -l /etc/localtime
ls -l /var/lib/lxc/unity8-lxc/rootfs/etc/localtime

?

Revision history for this message
Philipp (philipp-pfahofa) wrote :

# ls -l /etc/localtime
-rw-r--r-- 1 root root 2335 Apr 10 23:13 /etc/localtime

# ls -l /var/lib/lxc/unity8-lxc/rootfs/etc/localtime
lrwxrwxrwx 1 root root 27 Apr 10 06:02 /var/lib/lxc/unity8-lxc/rootfs/etc/localtime -> /usr/share/zoneinfo/Etc/UTC

# ls -l /usr/share/zoneinfo/Etc/UTC
lrwxrwxrwx 1 root root 7 Apr 10 23:12 /usr/share/zoneinfo/Etc/UTC -> ../Zulu

# ls -l /usr/share/zoneinfo/Etc/Zulu
lrwxrwxrwx 1 root root 7 Apr 10 23:12 /usr/share/zoneinfo/Etc/Zulu -> ../Zulu

Zulu seems to be a link on itself, that cant work I guess?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

No that should actually be ok, it's ../Zulu not ./Zulu.

Could you show the contents of

/var/lib/lxc/unity-lxc/config
/var/lib/lxc/unity-lxc/fstab

(I'll also be asking for contents of any files listed in lxc.include lines)

no longer affects: tzdata (Ubuntu)
Revision history for this message
Philipp (philipp-pfahofa) wrote :
Revision history for this message
Philipp (philipp-pfahofa) wrote :
Revision history for this message
Philipp (philipp-pfahofa) wrote :
Revision history for this message
Philipp (philipp-pfahofa) wrote :
Revision history for this message
Philipp (philipp-pfahofa) wrote :
Revision history for this message
Philipp (philipp-pfahofa) wrote :

There is no fstab.

I did update my Ubuntu, reinstalled unity8-lxc and created a new lxc container.

Now i get:

# unity8-lxc-session
lxc-attach: attach.c: lxc_attach: 730 failed to get the init pid
/usr/bin/unity8-lxc-session: 30: /usr/bin/unity8-lxc-session: cannot create /proc//root/etc/passwd: Directory nonexistent

# lxc-start -F -n unity8-lxc
lxc-start: utils.c: open_without_symlink: 1623 Too many levels of symbolic links - localtime in /usr/lib/x86_64-linux-gnu/lxc/etc/localtime was a symbolic link!
lxc-start: conf.c: mount_entry: 1650 Too many levels of symbolic links - failed to mount '/etc/localtime' on '/usr/lib/x86_64-linux-gnu/lxc/etc/localtime'
lxc-start: conf.c: lxc_setup: 3730 failed to setup the mount entries for 'unity8-lxc'
lxc-start: start.c: do_start: 819 failed to setup the container
lxc-start: sync.c: __sync_wait: 52 An error occurred in another process (expected sequence number 2)
lxc-start: start.c: __lxc_start: 1329 failed to spawn 'unity8-lxc'
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Can you confirm that this still happens with ppa:ubuntu-lxc/daily?

Revision history for this message
Philipp (philipp-pfahofa) wrote :

Yes.

The ppa updated following packages:

lxc1 amd64 2.0.0+master~20160415-1123-0ubuntu1~xenial
python3-lxc amd64 2.0.0+master~20160415-1123-0ubuntu1~xenial
liblxc1 amd64 2.0.0+master~20160415-1123-0ubuntu1~xenial
lxc-common amd64 2.0.0+master~20160415-1123-0ubuntu1~xenial
lxc-templates amd64 2.0.0+master~20160415-1123-0ubuntu1~xenial

Still I cannot start the session nor update it.

I will upgrade my laptop to Xenial as well soon and try it again with a fresh install on other hardware.

Revision history for this message
Philipp (philipp-pfahofa) wrote :

Did a fresh install, could it possibly be that the unity8-lxc package vanished from xenial?
Because I don't know how to create the lxc container by hand.

Changed in lxc (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.